Repository navigation
deploy: modular nginx site files on sysweb1's shared host layer - #34
Merged
Merged
Conversation
sysweb1 now has a host layer in Ubuntu's own layout -- snippets/https.conf, cloudflare.conf, static-spa.conf, proxy.conf, conf.d/sysweb1.conf and a catch-all site that is the only default_server (port 80 for every name: ACME + redirect; 443 for unknown names: handshake refused). nginx.conf and the package's default site are untouched; default is only disabled. So each BeanWeb site file is one 443 server block of includes, named after its hostname (deploy/nginx/beanweb.halicode.com, beanweb-test.halicode.com), with no port-80 block. Both are installed on sysweb1 and byte-identical to these files. deploy/README.md documents the host layer they depend on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
TLS, origin enforcement, routing, caching, and rollback depend on host-only configuration and scripts absent from the checkout, requiring maintainer verification of the composed configuration and reported rollout checks.
No open issues 🎉
What changed in this PR
Aligns BeanWeb’s production and test nginx site files with sysweb1’s externally maintained shared host layer, removing duplicated configuration while retaining site-specific settings.
Changes:
- Replaces the
.conffiles with hostname-named HTTPS configurations using shared snippets. - Delegates port-80 redirects and certificate challenges to the host’s catch-all site.
- Updates deployment instructions and the Coffee Shop proxy example.
| File | Description |
|---|---|
deploy/README.md |
Documents host dependencies, certificate issuance, and site installation. |
deploy/nginx/beanweb.halicode.com |
Adds the modular production HTTPS configuration. |
deploy/nginx/beanweb.conf |
Removes the superseded production configuration. |
deploy/nginx/beanweb-test.halicode.com |
Adds the modular test HTTPS configuration. |
deploy/nginx/beanweb-test.conf |
Removes the superseded test configuration. |
coffeeshop/README.md |
Updates site paths and demonstrates the shared proxy snippet. |
Review effort: Balanced
The host layer now closes non-Cloudflare connections with 444 (no status, headers or page) instead of a 403 that named nginx's version and OS, and sets server_tokens off per server block. By IP or by sysweb1's own name the box answers nothing on 80 and refuses the TLS handshake on 443. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
sysweb1 now has a shared host layer for nginx, laid out the way Ubuntu lays out its own files. Each site file is now about 20 lines of includes, where it used to be 83 lines that were mostly copies of each other. This PR brings BeanWeb's two site files in line with that layer. Both files are already installed on sysweb1 and are byte-identical to the versions here.
The host layer, in
/etc/nginxon sysweb1. It is maintained outside this repo;deploy/README.mddescribes it.sites-available/catch-alldefault_server. On port 80 it serves every hostname: it answers Let's Encrypt challenges, then redirects to https. On 443 it refuses the TLS handshake for any name without a site file, so no certificate or hostname leaks.snippets/https.confhttp2, Let's Encrypt challenges on 443, andserver_tokens off.snippets/cloudflare.conf444, so it gets no status, headers or page.snippets/static-spa.confandsnippets/static.confsnippets/proxy.confconf.d/sysweb1.confvhostlog format (hostname first, plus backend timing), gzip types, the TLS session cache, and the upgrade map.nginx.confand the package'sdefaultsite are not edited, because both belong to thenginx-commonpackage.defaultis only disabled, which is what its own header comment recommends.Changes in this repo:
deploy/nginx/beanweb.halicode.comandbeanweb-test.halicode.com(renamed frombeanweb.confandbeanweb-test.conf). Each is one 443 server block with no port-80 block, since the catch-all handles port 80.deploy/README.mddocuments the host layer and the new certificate and install steps.coffeeshop/README.mdshows the proxy block usingsnippets/proxy.conf.Testing
nginx.confand Cloudflare range files. Results:nginx -tfailed. Both sites stayed at 200/301/200 after every step.nginx -tshows no warnings.sysweb1.halicode.com, port 80 closes the connection with no reply, and 443 refuses the TLS handshake without showing a certificate. Through Cloudflare, error pages say onlynginx, with no version or OS.certbot renew --dry-runsucceeds for both certificates; the real Let's Encrypt validation came in through the catch-all.🤖 Generated with Claude Code