yii2
yii2 copied to clipboard
https request port
https return getServerPort() 80

What's the URL?
https://example.com/ вывожу Yii::$app->request->getServerPort()
ссылку могу убрать?
@andrtechno вангую что ты используешь nginx и не можешь нормально его сконфигурировать @samdark close issue, error in server config
Closing since wasn't able to reproduce it with nginx + php-fpm.
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.