Files
ttl.sh/ansible/templates/nginx_site.conf.j2
Marc Campbell f2ac28558f Add Next.js website with SSR support
- Create new Next.js app in web/ directory
- Configure standalone output for Docker deployment
- Add Dockerfile with multi-stage build
- Add web service to docker-compose.yaml
- Update nginx to proxy to Next.js container (port 3000)
- Remove static site deployment from Ansible

The website now runs as a containerized Next.js app with SSR,
enabling dynamic features and modern React development.

Note: Static site in static/ folder retained for reference.
Signed-off-by: Marc Campbell <marc.e.campbell@gmail.com>
2026-02-03 12:30:42 +00:00

53 lines
1.9 KiB
Django/Jinja

server {
listen 80;
server_name {{ domain_name }};
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name {{ domain_name }};
ssl_certificate /etc/letsencrypt/live/{{ domain_name }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ domain_name }}/privkey.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
# Next.js web app
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
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_cache_bypass $http_upgrade;
}
# Block listing catalog
location ~ v2/_catalog$ {
return 401;
}
# Docker Registry proxy
location /v2 {
client_max_body_size 10000m;
client_body_timeout 3600s;
proxy_connect_timeout 300s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;
send_timeout 3600s;
proxy_pass http://127.0.0.1:5000;
proxy_set_header X-Forwarded-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_set_header Host $host;
proxy_request_buffering off;
}
}