1
0
dwelling-files/configs/nginx.conf

39 lines
1.4 KiB
Nginx Configuration File
Raw Normal View History

server {
listen 443 ssl http2;
listen 127.0.0.1:8112; # I2P
2022-10-31 02:08:02 +04:00
listen [300:a98d:d6d0:8a08::d]:80; # Yggdrasil
server_name files.arav.top files.arav.i2p qf5e43nlhvnrutmikuvbdfj3cmtthokpbaxtkm6mjlslttzvtgm4fxid.onion;
access_log /var/log/nginx/dwelling/files.log main if=$nolog;
ssl_certificate /etc/letsencrypt/live/arav.top/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/arav.top/privkey.pem;
add_header Content-Security-Policy "default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self'; media-src 'self'; object-src 'none'; frame-src 'none'; frame-ancestors 'none'; font-src 'self'; form-action 'self'";
add_header X-Frame-Options "DENY";
add_header X-Content-Type-Options "nosniff";
add_header X-XSS-Protection "1; mode=block";
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
add_header Onion-Location "http://qf5e43nlhvnrutmikuvbdfj3cmtthokpbaxtkm6mjlslttzvtgm4fxid.onion$request_uri";
location / {
proxy_pass http://unix:/var/run/dwelling-files/f.sock;
proxy_set_header X-Client-Timezone "$gi2_location_tz";
proxy_set_header Host $host;
proxy_set_header Schema "https";
proxy_set_header X-Real-IP $remote_addr;
}
location /file/ {
alias /srv/ftp/;
autoindex on;
}
}