- nginx: add /photos and /uploads proxy routes to gallery-backend so the browser can reach the gallery API without needing direct port access - gallery.js: drop hardcoded port/subdomain fallbacks; use same-origin path via the new nginx routes - square.ts: pass buyerEmailAddress to createPayment so Square auto-sends a payment receipt to the customer on capture - square.ts: create fulfillments in RESERVED state (was PROPOSED) so staff can mark orders complete/filled directly from the Square dashboard - CartDrawer: merge Custom Vinyl into the Shape Balloon line item (one fewer Square line item per vinyl order); show modifier price deltas in cart Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
85 lines
3.9 KiB
Nginx Configuration File
85 lines
3.9 KiB
Nginx Configuration File
events {}
|
|
|
|
http {
|
|
# ── Compression ──────────────────────────────────────────────────────────────
|
|
gzip on;
|
|
gzip_types text/plain text/css text/javascript application/javascript application/json image/svg+xml;
|
|
gzip_min_length 1024;
|
|
gzip_vary on;
|
|
|
|
# ── Upstreams ─────────────────────────────────────────────────────────────────
|
|
upstream estore {
|
|
server estore:3000;
|
|
}
|
|
|
|
upstream main_site {
|
|
server main-site:3050;
|
|
}
|
|
|
|
upstream gallery {
|
|
server gallery-backend:5000;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
client_max_body_size 20m;
|
|
|
|
# ── Security headers ─────────────────────────────────────────────────────
|
|
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;
|
|
|
|
# ── Redirect old color-picker URL ────────────────────────────────────────
|
|
location ~ ^/color-picker(/.*)?$ { return 301 /color$1; }
|
|
|
|
# ── Redirects for legal pages (moved from main site into estore) ─────────
|
|
location = /privacy { return 301 /shop/privacy; }
|
|
location = /privacy/ { return 301 /shop/privacy; }
|
|
location = /terms { return 301 /shop/terms; }
|
|
location = /terms/ { return 301 /shop/terms; }
|
|
location = /refund { return 301 /shop/refund; }
|
|
location = /refund/ { return 301 /shop/refund; }
|
|
|
|
# ── Gallery API and uploaded images ──────────────────────────────────────
|
|
location ^~ /photos {
|
|
proxy_pass http://gallery;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
}
|
|
|
|
location ^~ /uploads {
|
|
proxy_pass http://gallery;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
}
|
|
|
|
# ── eStore: /shop and everything under it ────────────────────────────────
|
|
location ^~ /shop {
|
|
proxy_pass http://estore;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
}
|
|
|
|
# ── Main site: everything else ───────────────────────────────────────────
|
|
location / {
|
|
proxy_pass http://main_site;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
}
|
|
}
|
|
}
|