Connecting E-01 through Cloudflare while keeping password protection
Seven exact Worker exceptions, one proxied A and GET reconciliation without another POST. Edge checks verify TLS, passwords and privacy.
One learning hostname in an existing zone
After restricting the firewall, I connected the educational E-01 hostname through Cloudflare. This uses an existing zone with DNS records, Workers and rules already in place. I did not create an account or zone from scratch. The task was narrow: point one exact name to the origin, keep it password-protected and preserve other hosts’ behavior.
Before writing, I reread routes, DNS, Custom Domains and zone settings. The new ingress token lacked Scripts Read: the required read attempt returned 403. I did not broaden its permissions. A separate GET checked Custom Domains using the existing Workers deployment role. This separates permissions rather than giving the new token access to everything.
Seven exceptions without a Worker
Workers routes already existed in the zone. I added seven no-script exceptions for the exact learning hostname so the required path families reach the origin without running a Worker. The POST body contains only pattern: script is omitted. The anonymized example below shows one pattern, not the entire actual seven-rule set.
POST /client/v4/zones/<ZONE_ID>/workers/routes
Content-Type: application/json
{
"pattern": "demo.example.com/sitemap.xml*"
}
The original 14 routes remained unchanged; the total became 21. Worker code, zone settings and other hosts were unchanged. The exact hostname matters: an exception must not extend to neighboring domains.
One proxied A record
After the routes, I created one DNS A record with proxied=true and automatic TTL. In the standard API, automatic TTL is represented by 1. The example replaces the IP and zone ID with placeholders; it shows the request body without an access token.
POST /client/v4/zones/<ZONE_ID>/dns_records
Content-Type: application/json
{
"type": "A",
"name": "demo.example.com",
"content": "<ORIGIN_IPV4>",
"proxied": true,
"ttl": 1
}
Cloudflare API: Create DNS Record
After the single POST, the list already contained 38 rows, but total_count still said 37. Verification stopped on that contradiction. Repeating POST would have been unsafe: the list response did not establish that creation had failed. Fresh GETs returned a consistent 38 records and the exact existing new record. All 37 original records and all 21 routes were preserved; there was no second POST.
Checking through the public edge
Public TLS verification succeeded without disabling certificate trust. I performed GET and HEAD checks on 13 selected paths, covering seven route families, suffixes, query strings, case and match boundaries. Application responses without a password returned 401; a wrong password also gave 401. The correct password reached Symfony: the minimal skeleton’s expected 404.
# Anonymized hostname; use your real authorized test hostname.
# No --insecure: public certificate verification stays enabled.
curl --silent --show-error --head https://demo.example.com/
# curl prompts for the password; do not append it to the username.
curl --silent --show-error --head \
--user '<HTTP_USERNAME>' https://demo.example.com/
The fields below are selected actual root HEAD response fields. No domain address appears here; other operational fields are omitted. These are application responses through the edge, not a promise of identical headers on every Cloudflare page.
# Selected actual root HEAD response fields; unrelated fields omitted.
# Without credentials:
# HTTP status: 401
cache-control: private, no-store
x-robots-tag: noindex, nofollow
# With correct credentials:
# HTTP status: 404
cache-control: private, no-store
x-robots-tag: noindex, nofollow
The tested application HTTPS responses retained noindex/nofollow and private/no-store. No authenticated cache HIT was observed. HTTP at the edge returned 301 because Always Use HTTPS was already enabled, while local origin inspection gives 308. Those statuses belong to different layers.
Where Cloudflare itself answers
The edge request to /.env received a Cloudflare block page with status 403. It has no origin X-Robots-Tag header, so saying that every HTTPS response has noindex would be incorrect. The local origin returns 404 for /.env. The /other.php edge request also returned 404, this time from the origin.
Direct TCP connections from the laptop to the public origin on 80 and 443 remained unavailable. This separately establishes the tested network boundary: access through Cloudflare does not mean direct access is open from this client network.
A working hostname, with installer work still separate
The actual connection was made manually through the API: seven exceptions and one DNS record, followed by separate reads and HTTP checks. An automated typed CLI writer for these provider actions remains next work. Automation of the preceding firewall step does not mean the CLI already creates these new records.