Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
68 lines (55 sloc) 1.68 KB
# Some optimizations guides I found helpful:
#
# https://github.com/agile6v/awesome-nginx
# http://articles.slicehost.com/2009/2/20/centos-nginx-configuration
# https://bjornjohansen.no/optimizing-https-nginx
# https://github.com/easypath/nginx-secure-configs
#
worker_processes 2;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
keepalive_timeout 4;
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
upstream django {
server webserver:85;
}
# Non-SSL Website
server {
listen 80;
server_name localhost;
#######################################
#
# Rewrite Rules:
#
#rewrite ^ https://$server_name$request_uri? permanent;
#rewrite ^ https://REPLACE_WITH_YOUR_FQDN.com$request_uri? permanent;
root /opt/web/static;
location /
{
include uwsgi_params;
uwsgi_pass django;
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;
}
location /static {
alias /opt/web/static;
autoindex off;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}