Commit 0d43a140 by Vik Paruchuri

Change headers in nginx to work with django allowed_hosts

parent b79a0439
......@@ -2,6 +2,11 @@ server {
listen {{nginx_listen_port}};
server_name localhost;
set $my_host $http_host;
if ($host ~ "\d+\.\d+\.\d+\.\d+") {
set $my_host "127.0.0.1";
}
# https://docs.djangoproject.com/en/dev/howto/static-files/#serving-static-files-in-production
location /static/ { # STATIC_URL
alias {{ml_api_dir}}/staticfiles/;
......@@ -18,7 +23,7 @@ server {
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
proxy_set_header X-Forwarded-Port $http_x_forwarded_port;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Host $my_host;
proxy_pass http://127.0.0.1:7999;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment