Move the retired nginx and certbot into .deprecated
Nothing references nginx/ or certbot/ since the cutover to Caddy (daa2a46),
so they join quartz, hasura and autoheal in .deprecated/, with a README
entry on how to bring them back. The rollback steps in DEPLOYMENT.md §7 now
revert this commit and then the cutover. The host keeps ./certbot/conf (the
last certbot certificate, valid until 2027-01-20) and ./logs/nginx until the
rollback is no longer wanted; .gitignore still covers certbot/conf and
certbot/www for that reason.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
# =============================================================================
|
||||
# nginx_dev.conf.template — LOCAL DEVELOPMENT config.
|
||||
#
|
||||
# WHEN IT IS USED
|
||||
# Rendered by nginx/entrypoint.sh whenever DEV_MODE=true, which is set only
|
||||
# by docker-compose.dev.yml. Never used on the Pi.
|
||||
#
|
||||
# HOW IT DIFFERS FROM nginx.conf.template
|
||||
# - `/` is proxied to the Vite dev server at vue:5173 instead of serving
|
||||
# built files from disk. The Upgrade/Connection headers on that block are
|
||||
# for Vite's HMR websocket, not for the app.
|
||||
# - No HTTP->HTTPS redirect and no apex->www redirect: BOTH :80 and :443
|
||||
# serve the full site, so http://localhost just works. The two server
|
||||
# blocks therefore share one body, nginx_dev_common.conf.template.
|
||||
# - TLS uses the self-signed /etc/letsencrypt/live/localhost/ certificate that
|
||||
# the entrypoint generates, not a Let's Encrypt one. Browsers will warn.
|
||||
# - No HSTS or other security headers — HSTS on localhost would poison the
|
||||
# browser for every other localhost project on the machine.
|
||||
# - No `graphql` rate-limit zone (the production template has one); GraphQL
|
||||
# falls under the general `api` limit here.
|
||||
# - No /assets/, /fonts/, /img/ cache-control blocks: Vite serves those and
|
||||
# long cache lifetimes would defeat hot reload.
|
||||
#
|
||||
# TEMPLATING
|
||||
# Same envsubst allow-list as production. Every other dollar token is an
|
||||
# nginx runtime variable and must survive substitution untouched.
|
||||
#
|
||||
# INCLUDE CHAIN
|
||||
# this file -> nginx_dev_common.conf (once per server block: the dev-only
|
||||
# /uploads/ and `/` locations) -> nginx_routes.conf (the proxy route table
|
||||
# shared with production). The prefix-strip rewrite, the four forwarding
|
||||
# headers, the websocket upgrade block and the auth_request admin gate are
|
||||
# annotated in nginx_routes.conf.template; the rate-limit reasoning is in
|
||||
# nginx.conf.template.
|
||||
# =============================================================================
|
||||
|
||||
# As in production; why is in nginx.conf.template.
|
||||
worker_processes auto;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
server_tokens off;
|
||||
charset utf-8;
|
||||
|
||||
resolver 127.0.0.11 valid=10s;
|
||||
|
||||
client_max_body_size 50M;
|
||||
|
||||
# These four zones are referenced by limit_req lines in the SHARED
|
||||
# nginx_routes.conf.template, so they must exist here with the same names
|
||||
# as in nginx.conf.template or nginx refuses to load the config. Rates are
|
||||
# kept equal to production so a limit that would bite there bites here too.
|
||||
limit_req_zone $binary_remote_addr zone=login:10m rate=5r/m;
|
||||
limit_req_zone $binary_remote_addr zone=api:10m rate=30r/s;
|
||||
limit_req_zone $binary_remote_addr zone=upload:10m rate=30r/m;
|
||||
limit_req_zone $binary_remote_addr zone=hotel_search:10m rate=3r/m;
|
||||
|
||||
log_format compact
|
||||
'$remote_addr "$request" $status rt=$request_time';
|
||||
|
||||
access_log /var/log/nginx/access.log compact;
|
||||
|
||||
# JSON request-body log for Dozzle; see payload_log.conf.
|
||||
include /etc/nginx/payload_log.conf;
|
||||
|
||||
types {
|
||||
text/javascript mjs;
|
||||
}
|
||||
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_comp_level 6;
|
||||
gzip_min_length 256;
|
||||
gzip_types
|
||||
text/plain
|
||||
text/css
|
||||
text/javascript
|
||||
application/javascript
|
||||
application/json
|
||||
application/xml
|
||||
image/svg+xml
|
||||
font/woff2
|
||||
application/font-woff2;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name $DOMAIN www.$DOMAIN;
|
||||
|
||||
# The container healthcheck's target; see nginx.conf.template. Only in
|
||||
# this block, as in production, where it sits in the :80 server too.
|
||||
location = /nginx-health {
|
||||
access_log off;
|
||||
return 204;
|
||||
}
|
||||
|
||||
include /etc/nginx/nginx_dev_common.conf;
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name $DOMAIN www.$DOMAIN;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/localhost/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/localhost/privkey.pem;
|
||||
|
||||
include /etc/nginx/nginx_dev_common.conf;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user