Http POST drops port in URL

后端 未结 5 1965
遥遥无期
遥遥无期 2021-02-02 11:53

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

5条回答
  •  面向向阳花
    2021-02-02 11:57

    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

提交回复
热议问题