05/06 modified nginx.conf file
This commit is contained in:
+18
-33
@@ -1,23 +1,19 @@
|
||||
# ── Admin portal ────────────────────────────────────────────────
|
||||
# NOTE: HTTP only — upgrade to HTTPS with: sudo certbot --nginx -d admin.mydomain.com
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen 80;
|
||||
server_name admin.mydomain.com;
|
||||
|
||||
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;
|
||||
# IP allowlist — office / VPN only
|
||||
# allow 203.0.113.0/24;
|
||||
# deny all;
|
||||
|
||||
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;
|
||||
# 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;
|
||||
|
||||
location / {
|
||||
proxy_pass http://unix:/run/salon_pos_admin.sock;
|
||||
proxy_pass http://unix:/run/salonpos/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;
|
||||
@@ -26,29 +22,24 @@ server {
|
||||
}
|
||||
|
||||
location /static/admin/ {
|
||||
alias /opt/salon_pos/app/static/admin/;
|
||||
alias /home/salonpos/app/static/admin/;
|
||||
expires 7d;
|
||||
}
|
||||
}
|
||||
|
||||
# ── Tenant portal ────────────────────────────────────────────────
|
||||
# NOTE: HTTP only — upgrade to HTTPS with: sudo certbot --nginx -d mydomain.com
|
||||
server {
|
||||
listen 443 ssl;
|
||||
listen 80;
|
||||
server_name mydomain.com;
|
||||
|
||||
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'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; frame-ancestors 'none';" always;
|
||||
# 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 Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; frame-ancestors 'none';" always;
|
||||
|
||||
location / {
|
||||
proxy_pass http://unix:/run/salon_pos_tenant.sock;
|
||||
proxy_pass http://unix:/run/salonpos/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;
|
||||
@@ -57,13 +48,7 @@ server {
|
||||
}
|
||||
|
||||
location /static/tenant/ {
|
||||
alias /opt/salon_pos/app/static/tenant/;
|
||||
alias /home/salonpos/app/static/tenant/;
|
||||
expires 7d;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name admin.mydomain.com mydomain.com;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user