49 lines
1.9 KiB
Plaintext
49 lines
1.9 KiB
Plaintext
# Include inside the existing HTTPS server block for manicandles.midastix.com.
|
|
# This supplies the root and locations. Keep the existing TLS directives.
|
|
root /var/www/manicandles/current;
|
|
index index.html;
|
|
add_header X-Content-Type-Options nosniff always;
|
|
add_header Referrer-Policy strict-origin-when-cross-origin always;
|
|
add_header X-Frame-Options DENY always;
|
|
add_header Cache-Control "no-cache" always;
|
|
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https://www.transparenttextures.com; connect-src 'self'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
|
|
|
|
location /api/ {
|
|
proxy_pass https://manicandles-backend.midastix.com;
|
|
proxy_ssl_server_name on;
|
|
proxy_ssl_verify on;
|
|
proxy_ssl_verify_depth 3;
|
|
proxy_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt;
|
|
proxy_set_header Host manicandles-backend.midastix.com;
|
|
proxy_set_header Authorization $http_authorization;
|
|
# The backend rate-limits per client IP; it trusts this hop via TRUST_PROXY.
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_connect_timeout 10s;
|
|
proxy_read_timeout 20s;
|
|
proxy_hide_header Access-Control-Allow-Origin;
|
|
proxy_hide_header Access-Control-Allow-Credentials;
|
|
|
|
location ~ "^/api/v1/(?:(?:supplier-documents|b2b/artworks)/[0-9a-fA-F-]{36}/versions|products/[0-9a-fA-F-]{36}/images)$" {
|
|
client_max_body_size 3m;
|
|
proxy_pass https://manicandles-backend.midastix.com;
|
|
}
|
|
}
|
|
|
|
location = /release.txt {
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location /assets/ {
|
|
try_files $uri @previous_assets;
|
|
}
|
|
|
|
# Existing browser tabs may still request the preceding release's chunks.
|
|
location @previous_assets {
|
|
root /var/www/manicandles/previous;
|
|
try_files $uri =404;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|