I am running WordPress under the following configuration:
Varnish (Port 80) -> nginx (Port 8080)
This is all working great except when some plugin or other tries to get my server name using $_SERVER['SERVER_NAME']
. When that happens, it is getting back _:8080
as my server name and port. This is what the nginx config has:
server {
listen 8080;
server_name _;
What I need it to return is domain.com but if I change the nginx config, obviously, it stops listening on the port it needs to be (8080) (but changing the server_name works fine).
How can I have nginx listen on 8080 but have $_SERVER['SERVER_NAME']
return the correct port (or rather, not append the wrong port)?