Aug 21 - Fixed Forwarded host
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
# /etc/nginx/sites-available/jqc_lts
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
# Tenant-zero (LT Services). An exact server_name beats the *.jqc.app wildcard,
|
||||
# so this block wins for lts.jqc.app.
|
||||
#
|
||||
# Same MT-24 requirement as jqc_multi.conf: X-Forwarded-Host must be pinned.
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
http2 on;
|
||||
server_name lts.jqc.app;
|
||||
|
||||
client_max_body_size 50M;
|
||||
client_body_timeout 120s;
|
||||
proxy_connect_timeout 120s;
|
||||
proxy_send_timeout 120s;
|
||||
proxy_read_timeout 120s;
|
||||
|
||||
location / {
|
||||
proxy_pass http://127.0.0.1:8000;
|
||||
|
||||
proxy_set_header Host $host;
|
||||
# MT-24 — pin, never inherit from the client.
|
||||
proxy_set_header X-Forwarded-Host $host;
|
||||
proxy_set_header X-Forwarded-Port $server_port;
|
||||
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;
|
||||
|
||||
proxy_request_buffering on;
|
||||
proxy_buffer_size 16k;
|
||||
proxy_buffers 8 32k;
|
||||
proxy_busy_buffers_size 64k;
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
location /static {
|
||||
alias /home/jqc/janitorial_qc/app/static;
|
||||
expires 7d;
|
||||
add_header Cache-Control "public, immutable";
|
||||
access_log off;
|
||||
}
|
||||
|
||||
# MT-24: the /uploads alias is REMOVED.
|
||||
#
|
||||
# It published app/static/uploads at a second, shorter public path. Nothing
|
||||
# in the application generates /uploads/... URLs — LocalBackend builds
|
||||
# /static/uploads/... via url_for('static'), and the S3 backend issues
|
||||
# presigned URLs — so this route served no traffic the app depends on while
|
||||
# widening the unauthenticated surface for tenant photographs.
|
||||
#
|
||||
# Restore it ONLY if access logs show real traffic on /uploads/ from an
|
||||
# older client build:
|
||||
# grep -c ' /uploads/' /home/jqc/logs/janitorial-qc-access.log
|
||||
# Check before removing, not after.
|
||||
|
||||
access_log /home/jqc/logs/janitorial-qc-access.log;
|
||||
error_log /home/jqc/logs/janitorial-qc-error.log;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/lts.jqc.app/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/lts.jqc.app/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name lts.jqc.app;
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
Reference in New Issue
Block a user