59 lines
1.6 KiB
Django/Jinja
59 lines
1.6 KiB
Django/Jinja
upstream stats {
|
|
server unix:///tmp/stats.sock;
|
|
}
|
|
server {
|
|
listen [::]:80;
|
|
listen 80;
|
|
server_name stats.lineageos.org;
|
|
|
|
location /.well-known/ {
|
|
alias /var/www/stats.lineageos.org/.well-known/;
|
|
}
|
|
|
|
location / {
|
|
rewrite ^ https://$http_host$request_uri? permanent;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen [::]:443 ssl;
|
|
listen 443 ssl;
|
|
server_name stats.lineageos.org;
|
|
|
|
access_log /var/log/nginx/stats.access.log;
|
|
error_log /var/log/nginx/stats.error.log;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/stats.lineageos.org/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/stats.lineageos.org/privkey.pem;
|
|
|
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
|
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload;";
|
|
add_header X-Clacks-Overhead "GNU Terry Pratchett";
|
|
|
|
location / {
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header Host $http_host;
|
|
proxy_redirect off;
|
|
proxy_pass http://stats;
|
|
|
|
}
|
|
|
|
location /robots.txt {
|
|
alias /var/www/stats.lineageos.org/robots.txt;
|
|
}
|
|
|
|
location /static {
|
|
alias /srv/stats/app/static/;
|
|
}
|
|
|
|
location @proxy_to_app {
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header Host $http_host;
|
|
proxy_redirect off;
|
|
proxy_pass http://stats;
|
|
}
|
|
}
|
|
|