Files
MyPOS/deploy/nginx.conf
T
2026-05-07 12:17:19 -04:00

70 lines
2.7 KiB
Nginx Configuration File

# ── Admin portal ────────────────────────────────────────────────
server {
listen 443 ssl;
server_name posadmin.ngodanguyen.tech;
ssl_certificate /etc/ssl/certs/mydomain.crt;
ssl_certificate_key /etc/ssl/private/mydomain.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
allow 203.0.113.0/24;
deny all;
add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
location / {
proxy_pass http://unix:/run/salon_pos_admin.sock;
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;
client_max_body_size 5m;
}
location /static/admin/ {
alias /opt/salon_pos/app/static/admin/;
expires 7d;
}
}
# ── Tenant portal ────────────────────────────────────────────────
server {
listen 443 ssl;
server_name pos.ngodanguyen.tech;
ssl_certificate /etc/ssl/certs/mydomain.crt;
ssl_certificate_key /etc/ssl/private/mydomain.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
add_header Content-Security-Policy "default-src 'self'; script-src 'self' https://cdn.jsdelivr.net; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net; font-src 'self' https://cdn.jsdelivr.net; img-src 'self' data:; frame-ancestors 'none';" always;
location / {
proxy_pass http://unix:/run/salon_pos_tenant.sock;
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;
client_max_body_size 5m;
}
location /static/tenant/ {
alias /opt/salon_pos/app/static/tenant/;
expires 7d;
}
}
server {
listen 80;
server_name posadmin.ngodanguyen.tech pos.ngodanguyen.tech;
return 301 https://$host$request_uri;
}