Last active
April 7, 2017 21:39
-
-
Save MauricioDinki/a744e731fe0fe0e8ab98 to your computer and use it in GitHub Desktop.
nginx server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream app_server { | |
server 127.0.0.1:9000 fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name <server name>; | |
return 301 https://$server_name$request_uri; | |
} | |
server { | |
listen 443; | |
ssl on; | |
ssl_certificate <path to .cer file>; | |
ssl_certificate_key <path to .key file>; | |
ssl_verify_depth <verify depth>; | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
client_max_body_size 4G; | |
server_name <server name>; | |
keepalive_timeout 5; | |
# Your Django project's media files - amend as required | |
location /media { | |
alias <your media url>; | |
} | |
# your Django project's static files - amend as required | |
location /static { | |
alias <your static url>; | |
} | |
location / { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://app_server; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment