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

Add always to add_header and other http verbs in nginx config #116

Closed
wants to merge 1 commit into from
Closed

Conversation

vp993
Copy link

@vp993 vp993 commented Jul 10, 2016

By default, Nginx add_header directive does not work if HTTP status code is 40x or 50x. To make it work regardless status code, I added always at the end. Related to #106

Also, I added PUT, PATCH, and DELETE verbs to the Access-Control-Allow-Methods and a little bit refactored code.

Please let me know if you have any questions.

By default, Nginx add_header directive does not work if HTTP status code is 40x or 50x. To make it work regardless status code, I added `always` at the end. Related to #106

Also, I added `PUT`, `PATCH`, and `DELETE` verbs to the `Access-Control-Allow-Methods` and a little bit refactored code.

Please let me know if you have any questions.
@ralph-tice
Copy link

This doesn't seem to have been tested -- you can't actually use || in an nginx if statement.

You can, however, use regex.

ex:

if ($request_method ~ '(POST|GET|PUT|PATCH|DELETE)' ) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants