49 lines
1.4 KiB
Plaintext
49 lines
1.4 KiB
Plaintext
# Template for new app confs.
|
|
# 1. Copy this file: cp _template.conf.example <domain>.conf
|
|
# 2. Replace photos.thekims.family with the actual domain
|
|
# 3. Replace UPSTREAM_NAME and CONTAINER:PORT with the app's container and port
|
|
# 4. Run issue-cert.sh <domain> if cert doesn't exist yet
|
|
# 5. Copy to argento, nginx -t && nginx -s reload
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name photos.thekims.family;
|
|
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
http2 on;
|
|
server_name photos.thekims.family;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/photos.thekims.family/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/photos.thekims.family/privkey.pem;
|
|
|
|
include /etc/nginx/conf.d/security-headers.inc;
|
|
|
|
# Use a variable so nginx starts even if the upstream is down
|
|
set $upstream_UPSTREAM_NAME http://localhost:2283;
|
|
|
|
location / {
|
|
proxy_pass $upstream_UPSTREAM_NAME;
|
|
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;
|
|
|
|
# Uncomment if the app uses WebSockets
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
}
|