Form POST Lost on an HTTP-to-HTTPS Redirect: Trace the Actual Hop
A form can display a confirmation page while never reaching the handler that should save its data. One cause is an HTTP-to-HTTPS redirect between the browser's first POST and the intended endpoint. The status code matters, but the decisive evidence is the next request the browser actually made. This guide traces that single hop, separates it from a normal post-handler 303, and provides a redacted test worksheet.
Boletolibre editorial team
Published
1. Locate the missing POST in the submission path
Start with a specific symptom: a visitor submits a form, but the expected record, notification or validation result is missing. Do not assume the redirect caused it merely because the site also moved to HTTPS. Pick the exact form and submit button, the expected HTTPS handler, and one safe expected side effect. A final 200 page or a visible success message is not proof that the handler ran.
There are two very different positions for a redirect. A pre-handler redirect answers the first submission request before the application processes the form. If the browser changes that POST to GET, the form body is not sent to the HTTPS handler. A post-handler 303 can instead be the application's deliberate next step after it processed the POST, sending the browser to a confirmation page. Mark the handler boundary on your trace before choosing a fix.[3][6]
2. Read the effective form action, not only the visible page URL
Inspect the rendered page in the browser. Record the page URL, the form's action and method, and the submitter you actually clicked. A button can override the form with formaction or formmethod. Relative actions resolve against the document's base URL, which may not be the address shown in the browser. A JavaScript submit handler or fetch call can replace the native form request. Network evidence determines which URL and method were actually sent.[9][10]
If the browser sends POST to an http: action, making the page itself HTTPS is insufficient. Prefer an action that points directly to the intended HTTPS endpoint, including the correct host and path. An HTTP-to-HTTPS redirect cannot retroactively protect a request body already sent over HTTP. A browser policy may upgrade a URL before transmission, so first verify whether any HTTP POST left the browser rather than inventing a hop.[7][9]
3. Read what the redirect code permits—and then verify behavior
The table describes automatic HTTP redirection of a POST. It is a protocol guide, not a prediction that every browser, script, intermediary or endpoint will behave the same way. Read the response's Location and the following request in the same trace.[6]
| Response to POST | What the next request may do | Meaning for this diagnosis |
|---|---|---|
| 301 / 302 | The user agent may change POST to GET. | A lost method/body is possible, not guaranteed; observe the next request. |
| 307 / 308 | Automatic redirection preserves the method. | POST may reach the HTTPS target, but the first body may already have gone to HTTP. |
| 303 | The client may retrieve the Location using GET or HEAD. | Normal after a processed POST; suspicious if it occurs before the form handler. |
RFC 9110 explicitly permits POST-to-GET rewriting for 301 and 302. For 307 the client must not change the method when automatically following; 308 is the permanent method-preserving counterpart. A 303 deliberately points to another resource after a request, often after a successful POST. None of these codes alone proves that the destination accepts the method or that application state survived a host change.[1][2][3][4][5]
4. Capture one safe browser-to-server hop trace
Use a staging environment or an authorized non-payment test route with synthetic values and a unique test nonce. Avoid live ticket purchases, registrations, email sends, uploads and repeated submissions that can create real effects. Open the browser Network panel before the test and preserve the log across navigation. Submit once. If a redirect is shown, record the first request's scheme, host, path and method; its response code and redacted Location; then the next request's scheme, host, path and method. Note the final response and whether the test nonce produced exactly one expected record.
Keep only safe metadata: timestamp and time zone, request or correlation ID if available, content type and approximate body size, and whether a cookie, Origin or authorization header was present. Do not paste values, raw bodies, full HAR files, CSRF tokens, personal data or credential-bearing query strings into the worksheet. Browser tools can omit an earlier request if the log was not preserved; pair the trace with sanitized CDN, web-server or application logs when possible. A missing browser entry is not evidence that a particular server handled the form.
Example: the observed chain is POST http://example.invalid/form → 301 Location: https://example.invalid/form → GET https://example.invalid/form. The next request no longer has the POST body; the form handler has not been shown to run. In a second chain, POST http://example.invalid/form → 307 → POST https://example.invalid/form preserves method, but the first submission was still directed to HTTP. In a third, POST https://example.invalid/form reaches the handler, which returns 303 to GET https://example.invalid/thanks after recording the synthetic nonce. These are distinct outcomes, not interchangeable fixes.[1][3][4][7]
Branch on what the trace actually shows. If no HTTP request occurred, inspect client-side validation, JavaScript interception and the HTTPS handler before changing a redirect rule. If the first request is already POST to the correct HTTPS path, the scheme hop is not the missing-POST cause. If the next request remains POST but the result is empty, check which handler received it and whether it created the synthetic record. A redirect response and a successful application write are different observations.
5. Identify which layer sent the first redirect
The first Location could come from a CDN, ingress, web server, framework or application. Match the response timestamp and request ID to that layer's configuration or logs. Read its exact rule and the target path; do not infer a status from a control-panel label such as “force HTTPS.” The next hop may also change host or path. Even a preserved POST can then fail route matching or application checks, which is a separate finding from method rewriting.
Provider behavior is not universal. CloudFront's Redirect HTTP to HTTPS viewer policy uses 301 for GET/HEAD but 307 for POST and other listed methods on HTTP/1.1 or newer; older protocol versions can receive 403. NGINX rewrite redirect/permanent correspond to 302/301, while return can specify a code. Apache mod_alias Redirect defaults to 302 unless configured otherwise. These examples tell you what to verify in the active deployment; they are not a recommendation to switch every redirect to a permanent 308.[11][12][13]
A previously received permanent 301 or 308 may also be reused by a client cache. If the browser trace and today's server logs disagree, compare a fresh test context with the server-side rule and label which response was observed, rather than declaring the current configuration correct from a cached browser path. This is another reason not to deploy a permanent code before the target mapping is settled.[1][5]
6. Repair the entry point, then test the handler separately
The cleanest correction is usually to make the rendered form's effective action target the intended HTTPS handler directly. Correct a button override, base URL or JavaScript request if that is the source. If the first redirect must remain for old URLs, let the routing owner choose a method-preserving, route-specific policy only after confirming the HTTPS endpoint accepts POST and the mapping is stable. A 307/308 protects method semantics on the next hop; it does not make the original HTTP submission private. Avoid changing a site-wide rule from one symptom.[9][4][5][7]
Retest with a fresh synthetic nonce after one change. Confirm the actual first request now goes to HTTPS, the expected endpoint receives POST, the final result matches the application design, and there is exactly one side effect. If POST reaches the target but fails, investigate that target's route, access or CSRF handling with application evidence. A final 405 is the separate case where the target does not support the received method and should include Allow; a 403 can reflect an access or policy decision. Do not disguise either by changing POST to GET.[8]
7. Copy the redacted hop-and-outcome worksheet
Make one copy per synthetic test. Write “unknown” where a value was not observed, and keep the record internal. The decisive comparison is the first request versus the request following Location, with the handler boundary and side effect recorded separately.
| Evidence field | Record |
|---|---|
| Test ID and UTC time | Synthetic nonce; date/time and observer |
| Page and submitter | HTTPS page; form action/method; button override or JavaScript |
| Expected handler | HTTPS scheme, host, path, method and one safe side effect |
| Hop 0 request | Redacted scheme/host/path; method; content type and approximate size |
| Hop 0 response | Status; redacted Location; issuing layer or unknown |
| Hop 1 request | Redacted scheme/host/path; method; body present yes/no/unknown |
| Handler boundary | Before handler, after confirmed handler, or unknown |
| Final observation | Status; Allow if 405; redacted request ID; nonce side-effect count |
| Correction and retest | Owner, one change, fresh nonce, next-hop method and outcome |
| Rollback or escalation | Rule owner and condition for reverting or handing off |
Sources and further reading
- RFC 9110 §15.4.2: 301 Moved PermanentlyIETF / RFC Editor · Accessed
- RFC 9110 §15.4.3: 302 FoundIETF / RFC Editor · Accessed
- RFC 9110 §15.4.4: 303 See OtherIETF / RFC Editor · Accessed
- RFC 9110 §15.4.8: 307 Temporary RedirectIETF / RFC Editor · Accessed
- RFC 9110 §15.4.9: 308 Permanent RedirectIETF / RFC Editor · Accessed
- RFC 9110 §15.4: RedirectionIETF / RFC Editor · Accessed
- RFC 9110 §4.2.2: https URI schemeIETF / RFC Editor · Accessed
- RFC 9110 §15.5.6: 405 Method Not AllowedIETF / RFC Editor · Accessed
- HTML Standard: Form submission algorithmWHATWG · Accessed
- Amazon CloudFront: Require HTTPS for viewersAmazon Web Services · Accessed
- NGINX: ngx_http_rewrite_module returnNGINX · Accessed
- Apache HTTP Server: mod_alias RedirectApache HTTP Server · Accessed