I have a webapp built with Django. I\'m currently running it off a laptop at home behind a router.
I have the router configured to route all traffic sent to a specific
You want to pass on the original HTTP Host header, which arrived at nginx:
proxy_set_header Host $http_host;
This appears to be a bug with the default configuration of nginx in Debian/Ubuntu, which uses only $host
: $host
will not contain the $server_port
.
(This is configured in /etc/nginx/proxy_params
for the Debian/Ubuntu package, and you might override it in your configuration after including it.)
Please note that $host:$server_port
is different from $http_host
.
See http://wiki.nginx.org/HttpCoreModule#.24host for an explanation.
Reported and fixed in Debian: http://bugs.debian.org/733016