Commit 89576f1d authored by Dave Lane's avatar Dave Lane

tweak nginx configuration

parent 0948c0d0
......@@ -34,24 +34,25 @@ server {
return 403;
}
# from https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/
location / {
try_files $uri @rewrite; # For Drupal <= 6
try_files $uri /index.php?$query_string; # For Drupal >= 7
}
location @rewrite {
rewrite ^/(.*)$ /index.php;
rewrite ^/(.*)$ /index.php?q=$1;
}
# Tweaked from https://www.drupal.org/project/ais
location ~* /(?:.+)/files/styles/adaptive/(?:.+)$ {
if ( $http_cookie ~* "ais=(?<ais_cookie>[a-z0-9-_]+)" ) {
rewrite ^/(.+)/files/styles/adaptive/(.+)$ /$1/files/styles/$ais_cookie/$2 last;
}
access_log off;
add_header X-Header "AIS Generator 1.0";
set $nocache_details "Skip";
try_files $uri @rewrite;
}
#location ~* /(?:.+)/files/styles/adaptive/(?:.+)$ {
# if ( $http_cookie ~* "ais=(?<ais_cookie>[a-z0-9-_]+)" ) {
# rewrite ^/(.+)/files/styles/adaptive/(.+)$ /$1/files/styles/$ais_cookie/$2 last;
# }
# access_log off;
# add_header X-Header "AIS Generator 1.0";
# set $nocache_details "Skip";
# try_files $uri @rewrite;
#}
......@@ -62,10 +63,12 @@ server {
}
location ~ '\.php$|^/update.php' {
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param QUERY_STRING $query_string;
fastcgi_intercept_errors on;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_split_path_info ^(.+?\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_read_timeout 2400;
#include fastcgi_params;
......@@ -74,16 +77,16 @@ server {
}
# Fighting with Styles? This little gem is amazing.
location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6
location ~ ^/sites/.*/files/styles/ { # For Drupal >= 7
try_files $uri @rewrite;
}
location ^~ /system/files/ {
location ~ ^(/[a-z\-]+)?/system/files/ {
log_not_found off;
access_log off;
expires 30d;
try_files $uri @rewrite;
try_files $uri /index.php?$query_string;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment