Files
ai-qpid-pvz/nginx/conf.d/ai.qpid.pro.conf.ssl
T

74 lines
1.9 KiB
Plaintext

server {
listen 80;
listen [::]:80;
server_name ai.qpid.pro;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
# Game Configurator & Admin Panel SPA
location /configurator/ {
alias /usr/share/nginx/html/configurator_work/;
index index.html;
try_files $uri $uri/ /configurator/index.html;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name ai.qpid.pro;
ssl_certificate /etc/letsencrypt/live/ai.qpid.pro/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ai.qpid.pro/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1d;
root /usr/share/nginx/html;
index index.html;
# Security Headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
# Certbot webroot
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
# Bug Reports & Feedback API proxy
location /api/bugs {
proxy_pass http://172.19.0.1:8001/api/bugs;
proxy_set_header Host $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;
}
# SPA Fallback & Static asset serving
# Game Configurator & Admin Panel SPA
location /configurator/ {
alias /usr/share/nginx/html/configurator_work/;
index index.html;
try_files $uri $uri/ /configurator/index.html;
}
location / {
try_files $uri $uri/ /index.html;
}
}