2

I have a header that is not taking in nginx. Say I have a header such as Strict-Transport-Securty.

add_header Strict-Transport-Security    'max-age=31536000; preload'  always;

Should max-age and preload be separated by a semi-colon and a space? No space? Commas only? How do I include multiple values? The add_header nginx docs don't mention this.

1 Answer 1

2

A semicolon is the correct way of separating Strict-Transport-Securty header values. Your line

add_header Strict-Transport-Security 'max-age=31536000; preload' always;

is correct.


You probably weren't able to find it in the Nginx docs because this is standardized in the IETF specification:

Strict-Transport-Security = "Strict-Transport-Security" ":"
                            [ directive ]  *( ";" [ directive ] )

See here: https://www.rfc-editor.org/rfc/rfc6797#section-6.1

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.