You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in /opt/docker/etc/nginx/vhost.conf, in a running container, I have the substitution of <ALIAS_DOMAIN> working well, but in a PHP app, the value of $_SERVER['SERVER_NAME'] is still _, as it should be.
What would be the best approach to get my WEB_ALIAS_DOMAIN env var used in PHP's $_SERVER['SERVER_NAME'] ?
I tried to write
fastcgi_param SERVER_NAME <ALIAS_DOMAIN>;
in a conf file in vhost.common.d but it does'nt work.
changed the title [-]Question : [Nginx] How to change "server_name" ?[/-][+]Question : [Nginx] How to change value of $_SERVER['SERVER_NAME'] from nginx conf ?[/+]on Apr 19, 2018
Activity
[-]Question : [Nginx] How to change "server_name" ?[/-][+]Question : [Nginx] How to change value of $_SERVER['SERVER_NAME'] from nginx conf ?[/+]nubam commentedon May 9, 2018
I am experiencing the exact same error.
PHP's sever name variable is set to
_
on my test site.In a workaround, I added the following code to /vhost.common.d/10-php.conf to get the correct domain name inside the container.
vertexvaar commentedon Jan 18, 2019
Another workaround: Overwrite vhost.conf in your Dockerfile and set the expected server name as first
server_name
argument.The real question is however why there is a
_
in the first place?thanhtoan1196 commentedon Dec 1, 2023
Any updates?
How to change $_SERVER without editing vhost manually?