49 lines
No EOL
1.3 KiB
Nginx Configuration File
49 lines
No EOL
1.3 KiB
Nginx Configuration File
upstream app_server {
|
|
# fail_timeout=0 means we always retry an upstream even if it failed
|
|
# to return a good HTTP response
|
|
|
|
# for UNIX domain socket setups
|
|
server unix:/tmp/gunicorn.sock fail_timeout=0;
|
|
|
|
# for a TCP configuration
|
|
# server 192.168.0.7:8000 fail_timeout=0;
|
|
}
|
|
|
|
server {
|
|
# use 'listen 80 deferred;' for Linux
|
|
# use 'listen 80 accept_filter=httpready;' for FreeBSD
|
|
listen 80 deferred;
|
|
client_max_body_size 4G;
|
|
|
|
# set the correct host(s) for your site
|
|
server_name localhost;
|
|
|
|
keepalive_timeout 5;
|
|
|
|
# path for static files
|
|
root /srv/__PROJECTNAME__;
|
|
|
|
# Static files
|
|
location /static/ {
|
|
access_log off;
|
|
}
|
|
|
|
# Uploaded media
|
|
location /media/ {
|
|
access_log off;
|
|
}
|
|
|
|
location / {
|
|
proxy_set_header Host $http_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-Proto $scheme;
|
|
proxy_set_header X-SSL-Client-Serial $ssl_client_serial;
|
|
proxy_set_header X-SSL-Client-Verify $ssl_client_verify;
|
|
proxy_set_header X-SSL-Client-S-DN $ssl_client_s_dn;
|
|
# 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://app_server;
|
|
}
|
|
} |