05/07 Phase 3: initial codes

This commit is contained in:
2026-05-07 12:17:19 -04:00
parent 6e5518c103
commit ce462c57b2
107 changed files with 6365 additions and 208 deletions
+35 -20
View File
@@ -1,19 +1,23 @@
# ── Admin portal ────────────────────────────────────────────────
# NOTE: HTTP only — upgrade to HTTPS with: sudo certbot --nginx -d admin.mydomain.com
server {
listen 80;
server_name admin.mydomain.com;
listen 443 ssl;
server_name posadmin.ngodanguyen.tech;
# IP allowlist — office / VPN only
# allow 203.0.113.0/24;
# deny all;
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 "DENY" always;
# add_header X-Content-Type-Options "nosniff" always;
# add_header Referrer-Policy "strict-origin-when-cross-origin" always;
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/salonpos/salon_pos_admin.sock;
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;
@@ -22,24 +26,29 @@ server {
}
location /static/admin/ {
alias /home/salonpos/app/static/admin/;
alias /opt/salon_pos/app/static/admin/;
expires 7d;
}
}
# ── Tenant portal ────────────────────────────────────────────────
# NOTE: HTTP only — upgrade to HTTPS with: sudo certbot --nginx -d mydomain.com
server {
listen 80;
server_name mydomain.com;
listen 443 ssl;
server_name pos.ngodanguyen.tech;
# 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;
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/salonpos/salon_pos_tenant.sock;
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;
@@ -48,7 +57,13 @@ server {
}
location /static/tenant/ {
alias /home/salonpos/app/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;
}