This commit is contained in:
Stefan Wieczorek
2022-06-29 15:25:59 +02:00
parent 0fd42dd8ee
commit ba79f952cf
2 changed files with 50 additions and 4 deletions

View File

@@ -21,9 +21,32 @@ server {
allow all;
}
location ~ (^|/)\. {
return 403;
}
{{settings}}
try_files $uri $uri/ /index.php?$args;
location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
location / {
try_files $uri /index.php?$query_string;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1;
}
location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7
try_files $uri /index.php?$query_string;
}
if ($request_uri ~* "^(.*/)index\.php/(.*)") {
return 307 $1$2;
}
index index.php index.html;
location ~ \.php$ {
@@ -39,7 +62,7 @@ server {
fastcgi_param PHP_VALUE "{{php_settings}}";
}
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ {
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|ico|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ {
add_header Access-Control-Allow-Origin "*";
expires max;
access_log off;