Skip to content

Instantly share code, notes, and snippets.

@mazz
Created July 17, 2017 01:48
Show Gist options
  • Select an option

  • Save mazz/e48f97c310e910b757c03b3306943dce to your computer and use it in GitHub Desktop.

Select an option

Save mazz/e48f97c310e910b757c03b3306943dce to your computer and use it in GitHub Desktop.
# Redirect all HTTP traffic to HTTPS
# Serve HTTP/HTTPS traffic
server {
listen 52.24.43.193:80;
server_name kjvinternational.co;
client_max_body_size 99m;
access_log /var/log/nginx/myapp.access.log;
error_log /var/log/nginx/myapp.error.log;
root /var/www;
# Expose Nginx status for monitoring applications
location /nginx_stub_status {
stub_status on;
allow 127.0.0.1;
deny all;
}
# Finally, send all non-media requests to the Django server.
location / {
include uwsgi_params;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Proto $scheme;
uwsgi_pass 127.0.0.1:8001;
uwsgi_pass_header X_FORWARDED_PROTO;
uwsgi_pass_header X_REAL_IP;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment