50 lines
1.1 KiB
Nginx Configuration File
50 lines
1.1 KiB
Nginx Configuration File
|
upstream nsupdate_server {
|
||
|
server unix:/srv/nsupdate/run/gunicorn.sock fail_timeout=0;
|
||
|
}
|
||
|
|
||
|
server {
|
||
|
listen :80;
|
||
|
server_name nsupdate.info;
|
||
|
return 301 http://www.nsupdate.info$request_uri;
|
||
|
}
|
||
|
|
||
|
server {
|
||
|
|
||
|
listen :80;
|
||
|
listen [::]:80;
|
||
|
server_name nsupdate.info ipv4.nsupdate.info ipv6.nsupdate.info;
|
||
|
server_tokens off;
|
||
|
|
||
|
client_max_body_size 4G;
|
||
|
|
||
|
access_log /srv/nsupdate/logs/nginx-access.log;
|
||
|
error_log /srv/nsupdate/logs/nginx-error.log;
|
||
|
|
||
|
location /favicon.png {
|
||
|
alias /srv/nsupdate/static/favicon.png;
|
||
|
}
|
||
|
|
||
|
location /static/ {
|
||
|
alias /srv/nsupdate/static/;
|
||
|
}
|
||
|
|
||
|
location / {
|
||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
|
# when doing https
|
||
|
# proxy_set_header X-Forwarded-Proto https;
|
||
|
proxy_set_header Host $http_host;
|
||
|
proxy_redirect off;
|
||
|
|
||
|
if (!-f $request_filename) {
|
||
|
proxy_pass http://nsupdate_server;
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
# Error pages
|
||
|
error_page 500 502 503 504 /500.html;
|
||
|
location = /500.html {
|
||
|
root /srv/nsupdate/static/;
|
||
|
}
|
||
|
}
|