Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NGINX: Use 308 redirect rather than 301 #4335

Merged
merged 3 commits into from
Sep 11, 2018
Merged

NGINX: Use 308 redirect rather than 301 #4335

merged 3 commits into from
Sep 11, 2018

Conversation

LindsayHill
Copy link
Contributor

Our default NGINX configuration redirects http:// requests to https://. This uses a 301 redirect. When clients see this, they will either switch PUT/POST requests to GET, or they may continue with PUT/POST, but with no payload.

This change uses HTTP 308 instead. The request method and body will be unchanged.

This will reduce confusion for people using custom code that targets http://<ST2>/, rather than https://<ST2>

Our default NGINX configuration redirects `http://` requests to `https://`. This uses a 301 redirect. When clients see this, they will either switch PUT/POST requests to GET, or they may continue with PUT/POST, but with no payload.

This change uses [HTTP 308](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308) instead. The request method and body will be unchanged.

This will reduce confusion for people using custom code that targets `http://<ST2>/`, rather than `https://<ST2>`
@LindsayHill
Copy link
Contributor Author

@armab would appreciate your input on this. No rush, does not need to be 2.9, could be 3.0.

@arm4b
Copy link
Member

arm4b commented Sep 11, 2018

According to https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2 the issue with 301 should be something rarely seen nowadays:

  Note: When automatically redirecting a POST request after
 receiving a 301 status code, some existing HTTP/1.0 user agents
 will erroneously change it into a GET request.

But still, good to have this improvement to be on the safe side 👍

Copy link
Member

@arm4b arm4b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff 👍

Didn't know about 308 specifics.

@LindsayHill LindsayHill merged commit a6beabd into master Sep 11, 2018
@arm4b arm4b deleted the lh/redirect branch September 11, 2018 18:38
@Kami Kami added this to the 2.9.0 milestone Sep 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants