Skip to content

Commit

Permalink
Merge pull request #1 from perusio/D7
Browse files Browse the repository at this point in the history
updating original
  • Loading branch information
MarioBaron committed Jun 28, 2015
2 parents 692bbc0 + 22a6318 commit 4f0d13b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
21 changes: 1 addition & 20 deletions apps/drupal/microcache_fcgi.conf
Expand Up @@ -23,29 +23,10 @@ fastcgi_ignore_headers Cache-Control Expires;
## Bypass the cache.
fastcgi_cache_bypass $no_cache;
fastcgi_no_cache $no_cache;
## Add a cache miss/hit status header.
add_header X-Micro-Cache $upstream_cache_status;

## To avoid any interaction with the cache control headers we expire
## everything on this location immediately.
expires epoch;
## Enable clickjacking protection in modern browsers. Available in
## IE8 also. See
## https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header
## This may conflicts with pseudo streaming (at least with Nginx version 1.0.12).
## Uncomment the line below if you're not using media streaming.
## For sites *not* using frames uncomment the line below.
#add_header X-Frame-Options DENY;
## For sites *using* frames uncomment the line below.
#add_header X-Frame-Options SAMEORIGIN;

## Block MIME type sniffing on IE.
add_header X-Content-Options nosniff;

## Strict Transport Security header for enhanced security. See
## http://www.chromium.org/sts. I've set it to 2 hours; set it to
## whichever age you want.
## Uncomment the line below if you're using HTTPS.
#add_header Strict-Transport-Security max-age=7200;

## If you're using a Nginx version greater than 1.1.11 then uncomment
## the line below. See:
Expand Down
8 changes: 8 additions & 0 deletions nginx.conf
Expand Up @@ -163,9 +163,17 @@ http {
## line below.
add_header X-Frame-Options DENY;

## Enable this if using HTTPS. See sites-available/example.com.conf
## for details.
#add_header Strict-Transport-Security "max-age=7200";

## Block MIME type sniffing on IE.
add_header X-Content-Options nosniff;

## Add a cache miss/hit status header. This can be disabled if not including
## any of the apps/drupal/microcache* files.
add_header X-Micro-Cache $upstream_cache_status;

## Include the upstream servers for PHP FastCGI handling config.
## This one uses the FCGI process listening on TCP sockets.
include upstream_phpcgi_tcp.conf;
Expand Down
10 changes: 8 additions & 2 deletions sites-available/example.com.conf
Expand Up @@ -171,10 +171,16 @@ server {
ssl_certificate /etc/ssl/certs/example-cert.pem;
ssl_certificate_key /etc/ssl/private/example.key;

# Disable SSL v3 protocol to fix POODLE bug.
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;

## Strict Transport Security header for enhanced security. See
## http://www.chromium.org/sts. I've set it to 2 hours; set it to
## whichever age you want.
add_header Strict-Transport-Security "max-age=7200";
## whichever age you want. However, we can't set this here because adding
## a header will drop all other headers set earlier. See
## http://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header
## for details. Instead, uncomment this in nginx.conf.
## add_header Strict-Transport-Security "max-age=7200";

root /var/www/sites/example.com;
index index.php;
Expand Down

2 comments on commit 4f0d13b

@perusio
Copy link
Owner

Choose a reason for hiding this comment

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

You know this won't work if you define any headers via add_header in a location? The reason why it's on a location (including the microcache_fcgi.conf file) is because it circumvents that. See: http://nginx.org/en/docs/http/ngx_http_headers_module.html#add_header

@perusio
Copy link
Owner

Choose a reason for hiding this comment

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

Stressing:

These directives are inherited from the previous level if and only if there are no add_header directives defined on the current level.

Please sign in to comment.