Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80; ## listen for IPv4
- listen [::]:80 default ipv6only=on; ## listen for IPv6
- server_name main;
- root /usr/share/drupal7; ## <-- Your only path reference.
- index index.php;
- ## Access and error logs.
- access_log /var/log/nginx/drupal_access.log;
- error_log /var/log/nginx/drupal_error.log;
- include apps/drupal/drupal_upload_progress.conf;
- location = /favicon.ico {
- log_not_found off;
- access_log off;
- }
- location = /robots.txt {
- allow all;
- log_not_found off;
- access_log off;
- }
- location ~ \..*/.*\.php$ {
- return 403;
- }
- # No no for private
- location ~ ^/sites/.*/private/ {
- return 403;
- }
- # Block access to "hidden" files and directories whose names begin with a
- # period. This includes directories used by version control systems such
- # as Subversion or Git to store control files.
- location ~ (^|/)\. {
- return 403;
- }
- location / {
- # This is cool because no php is touched for static content
- try_files $uri @cache;
- }
- location /sub1 {
- rewrite ^/([^/]*)/(.*)(/?)$ /$1/index.php?q=$2&$args;
- try_files $uri $uri/ @cache;
- }
- location /sub2 {
- rewrite ^/([^/]*)/(.*)(/?)$ /$1/index.php?q=$2&$args;
- try_files $uri $uri/ @cache;
- }
- location @drupal {
- rewrite ^ /index.php;
- }
- location ~ \.php$ {
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $request_filename;
- fastcgi_intercept_errors on;
- fastcgi_pass phpcgi;
- include apps/drupal/microcache_fcgi_auth.conf;
- track_uploads uploads 60s;
- }
- location ~ ^/sites/.*/files/styles/ {
- try_files $uri @drupal;
- }
- location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
- expires max;
- log_not_found off;
- }
- location @cache {
- ## Boost compresses can the pages so we check it. Comment it out
- ## if you don't have it enabled in Boost.
- gzip_static on;
- ## Error page handler for the case where $no_cache is 1. POST
- ## request or authenticated.
- error_page 418 = @drupal;
- ## If $no_cache is 1 then it means that either we have a session
- ## cookie or that the request method is POST. So serve the dynamic
- ## page.
- if ($no_cache) {
- return 418; # I'm a teapot/I can't get no cachifaction
- }
- ## No caching for POST requests.
- if ($request_method = POST) {
- return 418;
- }
- # Now for some header tweaking. We use a date that differs
- # from stock Drupal. Everyone seems to be using their
- # birthdate. Why go against the grain?
- add_header Expires "Tue, 13 Jun 1977 03:45:00 GMT";
- # We bypass all delays in the post-check and pre-check
- # parameters of Cache-Control. Both set to 0.
- add_header Cache-Control "must-revalidate, post-check=0, pre-check=0";
- # Funny...perhaps. Egocentric? Damn right!;
- add_header X-Header "Boost Helás Avril 1.0";
- ## Boost doesn't set a charset.
- charset utf-8;
- # We try each boost URI in succession, if every one of them
- # fails then relay to Drupal.
- try_files /cache/normal/$host${uri}_${args}.html /cache/perm/$host${uri}_.css /cache/perm/$host${uri}_.js /cache/$host/0$uri.html /cache/$host/0${uri}/index.html @drupal;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement