yii2 icon indicating copy to clipboard operation
yii2 copied to clipboard

https request port

Open andrtechno opened this issue 3 years ago • 3 comments

https return getServerPort() 80

gdfgsf

andrtechno avatar Jul 29 '22 21:07 andrtechno

What's the URL?

samdark avatar Jul 30 '22 10:07 samdark

https://example.com/ вывожу Yii::$app->request->getServerPort()

andrtechno avatar Jul 30 '22 10:07 andrtechno

ссылку могу убрать?

andrtechno avatar Jul 30 '22 12:07 andrtechno

@andrtechno вангую что ты используешь nginx и не можешь нормально его сконфигурировать @samdark close issue, error in server config

WinterSilence avatar Aug 11 '22 18:08 WinterSilence

Closing since wasn't able to reproduce it with nginx + php-fpm.

samdark avatar Aug 11 '22 20:08 samdark

I think you are misusing getServerPort. It's not robust way to detect your inbound port if you are behind any reverse proxy. For instance, Cloudflare doesn't pass this header at all, you will end up with port on which your nginx is accepting Cloudflare connections instead of translated one. If you want to just detect http/https, use Yii::$app->request->isSecureConnection instead.

SagePtr avatar Aug 24 '22 09:08 SagePtr