HTTPS and a password for E-01: Nginx, Origin CA and Symfony
A separate TLS vhost, BasicAuth, Host/SNI checks and the preserved private Symfony. Reconcile a package update before the complete CLI inspection.
HTTPS before connecting DNS
The Origin CA certificate was already ready. I installed it on educational E-01 and added a separate password-protected HTTPS vhost. I did not create public DNS yet: TLS, Symfony access and rejection paths came first. Nginx listens on IPv4 ports 80 and 443, but the existing firewall still blocks external connections to them.
Why a 404 status is insufficient
Preparation exposed a routing detail: a request to the private port with the future public Host reached the Nginx default server. It returned 404 with a 146-byte body. The private application Host reached Symfony: also 404, but with 993 bytes and a different checksum. The minimal skeleton has no homepage route, so its response is expected. The status and noindex header alone did not prove PHP execution.
A separate vhost preserving the private one
For TLS, I used the same public root and existing PHP-FPM socket directly. The initial plan to proxy through the private HTTP port would also require changing its Host and HTTPS parameter handling. The new configuration preserved the private include. Below are selected standard directives from the installed HTTPS server; paths are anonymized, and this is not a complete configuration to copy.
# Selected directives inside the dedicated HTTPS server.
# Paths are anonymized; this is not a complete server configuration.
listen 0.0.0.0:443 ssl;
server_name e01-demo.solution200.com;
ssl_certificate /etc/nginx/demo/origin.crt;
ssl_certificate_key /etc/nginx/demo/origin.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_session_tickets off;
auth_basic "E01 learning server";
auth_basic_user_file /etc/nginx/demo/auth.htpasswd;
if ($ssl_server_name != "e01-demo.solution200.com") { return 421; }
if ($host != "e01-demo.solution200.com") { return 421; }
add_header X-Robots-Tag "noindex, nofollow" always;
add_header Cache-Control "private, no-store" always;
Nginx: TLS handshake rejection
A password before static files and PHP
auth_basic is defined at server level and inherited by static content and the sole front controller, including after an internal redirect to index.php. The server received only a crypt hash generated using openssl passwd -6 -stdin. The password remains in a separate private local profile, absent from Git, process arguments and screenshots. The command illustrates secure input for reproducing the operation; its output is a hash, not the password.
read -rsp 'BasicAuth password: ' BASIC_PASSWORD
printf '\n'
printf '%s\n' "$BASIC_PASSWORD" | openssl passwd -6 -stdin
unset BASIC_PASSWORD
Nginx: HTTP Basic Authentication
File permissions
The E01 key and certificate are root:root with mode 0600. The auth file is root:www-data with mode 0640, in a 0750 directory: the Nginx worker must read the hash but cannot read the private key. The Nginx master loads the TLS key.
What PHP-FPM receives
The new TLS location explicitly sets HTTPS=on, port 443, the correct Host and a fixed index.php path. A request cannot choose an arbitrary PHP file. Forwarding all HTTP headers into FastCGI is disabled; required parameters are enumerated. Application cache and indexing headers are hidden, and the server supplies its own policy. This excerpt contains only those directives; the full configuration also includes the remaining FastCGI parameters and path guards.
# Selected directives inside the exact /index.php location.
fastcgi_pass unix:/run/php/demo.sock;
fastcgi_pass_request_headers off;
fastcgi_param SCRIPT_FILENAME /srv/demo/public/index.php;
fastcgi_param DOCUMENT_ROOT /srv/demo/public;
fastcgi_param HTTP_HOST e01-demo.solution200.com;
fastcgi_param HTTPS on;
fastcgi_param SERVER_PORT 443;
fastcgi_hide_header Cache-Control;
fastcgi_hide_header Expires;
fastcgi_hide_header X-Robots-Tag;
Testing without public DNS
A local TLS request on E01 uses --resolve: it connects to 127.0.0.1 while retaining e01-demo.solution200.com for TLS and HTTP. --cacert selects the previously verified Origin CA RSA root; certificate verification remains enabled. Below are reproducible command forms. The evidence collector supplied curl credentials through stdin; --user reader instead prompts for the password interactively.
# Run on E01. CA_FILE must point to the verified Origin CA RSA root.
curl --silent --show-error --noproxy '*' \
--cacert "$CA_FILE" \
--resolve e01-demo.solution200.com:443:127.0.0.1 \
-D - -o /dev/null https://e01-demo.solution200.com/
# curl prompts for the password; do not put it in shell history.
curl --silent --show-error --noproxy '*' \
--cacert "$CA_FILE" \
--resolve e01-demo.solution200.com:443:127.0.0.1 \
--user reader \
-D - -o /dev/null https://e01-demo.solution200.com/
The actual response without a password
The first request returned 401 and WWW-Authenticate. Only selected actual headers appear below; calendar and other service fields are omitted. This tests the password gate; the certificate separately passed hostname and CA trust verification.
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Basic realm="E01 learning server"
Cache-Control: private, no-store
X-Robots-Tag: noindex, nofollow
The correct password reaches Symfony
The authorized request returned 404. Its body checksum matched the private response from the same Symfony skeleton. I also tested RSS/sitemap paths and explicit index.php: 401 without a password and the expected Symfony 404 with one. The screenshot shows an actual terminal performing a fresh protected SSH read and displaying selected headers.
HTTP/1.1 404 Not Found
Cache-Control: private, no-store
X-Robots-Tag: noindex, nofollow
Names, denied paths and HTTP
For unknown SNI, the default TLS server rejects the handshake using ssl_reject_handshake on. Separately, correct SNI with a wrong HTTP Host returned 421. Requests for /.env, another PHP file and PHP path-info returned 404 before application execution. Such early rejection need not issue a password challenge. Port 80 only redirects the exact hostname with 308 to a fixed HTTPS hostname, preserving the URI and query; it does not request a password over HTTP.
# Inside the separate HTTP server for this exact hostname.
return 308 https://e01-demo.solution200.com$request_uri;
Applying the configuration
Before E01, the configuration passed 17 scenarios using isolated real Nginx and PHP-FPM processes, a test certificate and a PHP fixture. This did not replace testing Symfony on the server. After installing the new files, I ran nginx -t and one reload. The Nginx master PID stayed unchanged, as did the private include checksum. A fresh SSH check confirmed the configuration, file permissions and responses.
sudo nginx -t
sudo systemctl reload nginx.service
Inspecting the configured HTTPS role through the CLI
After manual installation, I prepared a separate https-inspect command. It reads the retained original plans and checks the whole private application state, including unchanged PHP-FPM and Nginx process identities. New TLS files require an exact inventory, content, ownership and permissions. The active certificate must match the verified local leaf, and the auth file must contain exactly one selected user. The invocation uses placeholder private paths; ARCHIVE_KEY_SHA256 is the previously recorded public APT keyring checksum. application-reference identifies the original plan and committed completion through paths and digests. https-file selects the hostname, TLS files, trusted CA and existing local password profile. Neither a password value nor a private key appears in the command. This operation only reads; automated installation, an adoption journal and network activation remain separate steps.
deploy-cli host application https-inspect \
--env-file /private/administrator.env \
--request-file /private/current-request.json \
--fpm-file /private/original-fpm.json \
--key-file /private/archive-keyring.gpg --key-sha256 "$ARCHIVE_KEY_SHA256" \
--activation-file /private/activation-reference.json \
--enable-file /private/enable-reference.json \
--minimal-file /private/minimal-reference.json \
--application-file /private/application-profile.json \
--application-reference /private/application-reference.json \
--https-file /private/https-profile.json
The first CLI invocation stopped at package verification. An automatic update installed a new libbrotli1 version, and the APT indexes had also changed. The retained original result no longer matched the current state. An additional read found no version changes among the original PHP packages and minimal extensions, but that alone cannot admit the entire new state. The command created no server files and performed no reload. Below are selected fields from the actual CLI response, rather than a server HTTP response. Reconciling the automatic update requires a separate step that preserves the earlier journal.
{
"status": "failed",
"write_performed": false,
"error": "HTTPS inspection refused existing state: parent/packages"
}
How the automatic update was checked
Comparing the 337 original package records identified one change: libbrotli1 from 1.1.0-2+b7 to 1.1.0-2+deb13u1. The other original records were preserved. The nine packages from the minimal PHP step and the automatic-install flags were checked separately against the retained result. I did not rewrite the old journal.
I verified the new version through the InRelease signature and validity period, the Packages index checksum, and the .deb archive SHA256 and size. The keyring matched the previously pinned one. I downloaded the archive to the laptop; its control fields confirmed the package name, version and architecture. All 7 regular files and 3 symbolic links matched those installed on E01. Signature verification used a temporary file under /run, which was removed afterward. I did not reinstall packages or refresh indexes.
The snapshots of the Nginx and PHP-FPM master and worker processes from their cgroups contained no loaded libbrotli mappings. This is a narrow observation of those processes at the time of reading; it does not establish the integrity of every server library. I performed no restart in this step. The following summary selects fields from the saved actual result and groups their names for readability; it is not raw command output.
{
"package": "libbrotli1",
"old_version": "1.1.0-2+b7",
"new_version": "1.1.0-2+deb13u1",
"signed_release_and_index_verified": true,
"archive_sha256_verified": true,
"installed_files_checked": 7,
"installed_symlinks_checked": 3,
"nginx_brotli_mappings": 0,
"fpm_brotli_mappings": 0,
"managed_package_state_changed": false
}
After the manual proof, the CLI components repeated the package comparison and the complete signed index verification on E01: from the pinned keyring through real sqv verification to the required archive record. Separate sqv checks rejected altered signed text, unsigned content and an invalid keyring; the last test used data that are not OpenPGP keys. Temporary files were removed after both success and refusal, and the package state remained unchanged. A separate immutable confirmation of the new state still needs to be saved and connected to https-inspect. The earlier refusal from that command remains the current result; a complete successful HTTPS inspection through the CLI has not yet been demonstrated.
What remains closed
Direct TCP connections from the laptop to the educational server’s ports 80 and 443 remain unavailable; the unchanged firewall retains its drop policy. noindex does not replace password or network protection, and no-store does not promise that no copy can exist. This step changed no DNS records, Worker routes or Strict zone setting. Next, the manual step needs a CLI capability, controlled access from Cloudflare, an exact-host rules review and then DNS.