Skip to content

Instantly share code, notes, and snippets.

@leafsummer
Created July 15, 2015 05:52
Show Gist options
  • Save leafsummer/4adf335e209f4d49e958 to your computer and use it in GitHub Desktop.
Save leafsummer/4adf335e209f4d49e958 to your computer and use it in GitHub Desktop.
nginx server conf
server {
listen 443;
charset utf-8;
ssl on;
ssl_certificate /opt/disk2/var/serverconfig/server.cert;
ssl_certificate_key /opt/disk2/var/serverconfig/server.key;
location / {
root /opt/disk2/var/www;
uwsgi_pass 127.0.0.1:9001;
include uwsgi_params;
}
# location /media/ {
# alias /opt/disk2/var/www/static/;
# limit_conn perip 10;
# limit_rate 200k;
# limit_req zone=portal burst=60;
# expires 5d;
# }
location /static/ {
expires 5d;
alias /opt/disk2/var/www/static/;
}
location ^(.*)\.favicon.ico$ {
log_not_found off;
}
location ~ /\.svn(.*)$ {
deny all;
}
}
server {
listen 80;
charset utf-8;
server_name localhost;
root /opt/disk2/var/www;
location / {
root /opt/disk2/var/www;
uwsgi_pass 127.0.0.1:9001;
include uwsgi_params;
}
# location /media/ {
# alias /opt/disk2/var/www/static/;
# limit_conn perip 10;
# limit_rate 200k;
# limit_req zone=portal burst=60;
# expires 5d;
# }
location /static/ {
expires 5d;
alias /opt/disk2/var/www/static/;
}
location ^(.*)\.favicon.ico$ {
log_not_found off;
}
location ~ /\.svn(.*)$ {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment