Skip to content

Instantly share code, notes, and snippets.

@barbietunnie
Created December 6, 2022 04:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barbietunnie/4c6fa2f89f6fe4e892e190f2c7128fe7 to your computer and use it in GitHub Desktop.
Save barbietunnie/4c6fa2f89f6fe4e892e190f2c7128fe7 to your computer and use it in GitHub Desktop.
How to fix – NGINX not accepting headers with underscore

How to fix – Nginx not accepting headers with underscore

Although headers with underscore are perfectly valid according to HTTP standards, however NGINX does not support it by default. To enable NGINX to accept headers with underscore, add the following directive within the server block of your NGINX configuration.

underscores_in_headers on;

Validate and reload the configuration after making this change as follows:

nginx -t
 
service nginx reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment