-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Reduces repetition of headers in nginx config file (#440)
* Rather than repeating add_header directives, use 1-line include directives instead to bring import an additional file * Makes the include files themselves hierarchical with further includes back to a single base include file
- Loading branch information
1 parent
c8453a0
commit 5bede35
Showing
6 changed files
with
29 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Do not specify "storage" as local storage contains persistent data such as | ||
# preferences and connections but without credentials. | ||
add_header Clear-Site-Data "\"cache\", \"cookies\""; | ||
add_header Cache-Control "no-store"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Prevent click jacking attacks | ||
add_header X-Frame-Options "SAMEORIGIN"; | ||
|
||
# Ensure only https is used for this server | ||
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
include /etc/nginx/includes/security-headers-base.conf; | ||
|
||
# Govern what content can be loaded by the server and from where | ||
# Click jacking prevention to be used in addition to X-Frame-Options | ||
add_header Content-Security-Policy "default-src 'self'; frame-ancestors 'self'; form-action 'self'; "; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include /etc/nginx/includes/security-headers-base.conf; | ||
|
||
# Govern what content can be loaded by the server and from where | ||
# Click jacking prevention to be used in addition to X-Frame-Options | ||
# Requires allowing inline-styles and inline data objects (svg imgs) | ||
add_header Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline'; font-src 'self' data:; img-src 'self' data:; frame-ancestors 'self'; form-action 'self'; "; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters