Skip to content

Commit

Permalink
Tidy up nginx.conf
Browse files Browse the repository at this point in the history
for #522
  • Loading branch information
philgyford committed Dec 3, 2022
1 parent fb6c8ad commit c2efbfe
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ server {
location = / {
try_files noexist @django;
}

# location = /index.html {
# try_files noexist @django;
# }
Expand All @@ -96,33 +97,24 @@ server {
# Try to serve the static html files from root.
root /webapps/hines/code/hines/static_html;
try_files $uri $uri/ @django;
# index index.html;
}

location @django {
# an HTTP header important enough to have its own Wikipedia entry:
# http://en.wikipedia.org/wiki/X-Forwarded-For
# http://en.wikipedia.org/wiki/X-Forwarded-For
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

# enable this if and only if you use HTTPS, this helps Rack
# set the proper protocol for doing redirects:
# helps set the proper protocol for doing redirects with https:
proxy_set_header X-Forwarded-Proto https;

# pass the Host: header from the client right along so redirects
# can be set properly within the Rack application
# can be set properly
proxy_set_header Host $http_host;

# we don't want nginx trying to do something clever with
# redirects, we set the Host: header above already.
proxy_redirect off;

proxy_pass http://hines_app_server;
# Try to serve static files from nginx, no point in making an
# *application* server like Unicorn/Rainbows! serve static files.
#if (!-f $request_filename) {
# proxy_pass http://hines_app_server;
# break;
#}
}

# Error pages
Expand Down

0 comments on commit c2efbfe

Please sign in to comment.