rDrama/nginx.conf

75 lines
2.0 KiB
Nginx Configuration File
Raw Normal View History

server {
2022-10-02 18:27:18 +00:00
server_name rdrama.net;
client_max_body_size 100m;
2022-10-04 19:48:52 +00:00
listen 80;
listen [::]:80;
proxy_set_header Host $http_host;
2022-10-30 00:48:25 +00:00
add_header Referrer-Policy "same-origin";
2022-10-30 00:59:33 +00:00
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
2022-10-30 00:46:50 +00:00
add_header X-Frame-Options "deny";
2022-10-30 00:59:33 +00:00
add_header X-Content-Type-Options "nosniff";
add_header Content-Security-Policy "script-src 'self' 'unsafe-inline' challenges.cloudflare.com rdrama.net; connect-src 'self' tls-use1.fpapi.io api.fpjs.io; object-src 'none';";
2022-10-02 18:27:18 +00:00
location / {
proxy_pass http://localhost:5000/;
2022-10-02 18:27:18 +00:00
}
location /socket.io {
2022-10-04 19:48:52 +00:00
proxy_set_header Host $http_host;
2022-10-02 18:27:18 +00:00
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://localhost:5001/socket.io;
2022-10-02 18:27:18 +00:00
}
location /chat {
proxy_pass http://localhost:5001/chat;
2022-10-02 18:27:18 +00:00
}
location /images/ {
include includes/serve-static;
}
location /videos/ {
include includes/serve-static;
}
location /audio/ {
include includes/serve-static;
}
2022-12-10 12:21:52 +00:00
location /songs/ {
include includes/serve-static;
}
2022-10-02 18:27:18 +00:00
location /asset_submissions/ {
include includes/serve-static;
}
2022-12-10 12:21:52 +00:00
location /archives/ {
include includes/serve-static;
}
location /assets/ {
alias /rDrama/files/assets/;
add_header 'Cache-Control' "public, max-age=3153600";
}
location /i/ {
alias /rDrama/files/assets/images/;
add_header 'Cache-Control' "public, max-age=3153600";
}
location /e/ {
alias /rDrama/files/assets/images/emojis/;
add_header 'Cache-Control' "public, max-age=3153600";
}
location /robots.txt {
alias /rDrama/files/assets/robots.txt;
add_header 'Cache-Control' "public, max-age=3153600";
}
location /icon.webp {
alias /rDrama/files/assets/images/rDrama/icon.webp;
add_header 'Cache-Control' "public, max-age=3153600";
}
error_page 502 = /error_page/502.html;
location /error_page/ {
2022-10-10 05:33:14 +00:00
alias /rDrama/files/templates/errors/rDrama/;
2022-12-10 12:34:38 +00:00
add_header Cache-Control "no-store";
}
2022-10-02 18:27:18 +00:00
}