new-site/infra/ansible/roles/nginx/templates/pw-dev-tls.conf.j2
justin f8cd37ac8c Initial commit — Performance West telecom compliance platform
Includes: API (Express/TypeScript), Astro site, Python workers,
document generators, FCC compliance tools, Canada CRTC formation,
Ansible infrastructure, and deployment scripts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-27 06:54:22 -05:00

52 lines
1.8 KiB
Django/Jinja

# {{ ansible_managed }}
# HTTPS config for dev.performancewest.net (dev stack — site + api combined)
# Dev site runs on port {{ dev_site_port }}, dev API on port {{ dev_api_port }}.
server {
listen 80;
server_name {{ dev_domain }} www.{{ dev_domain }};
location /.well-known/acme-challenge/ { root {{ certbot_webroot }}; }
location / { return 301 https://{{ dev_domain }}$request_uri; }
}
server {
listen 443 ssl;
http2 on;
server_name {{ dev_domain }} www.{{ dev_domain }};
ssl_certificate /etc/letsencrypt/live/{{ dev_domain }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ dev_domain }}/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
add_header Strict-Transport-Security "max-age=31536000" always;
client_max_body_size 50m;
# Proxy /api/* to the dev API container (avoids CORS issues in the browser)
location /api/ {
proxy_pass http://127.0.0.1:{{ dev_api_port }}/api/;
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;
proxy_read_timeout 120s;
}
location / {
proxy_pass http://127.0.0.1:{{ dev_site_port }};
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 /.well-known/acme-challenge/ {
root {{ certbot_webroot }};
}
}