This commit is contained in:
Stefan Wieczorek
2024-11-20 13:08:58 +01:00
parent a56b3ed165
commit bdb9d3b550
2 changed files with 18 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
#{"rootDirectory":"web","phpVersion":"8.1"} #{"rootDirectory":"web","phpVersion":"8.3"}
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
@@ -44,7 +44,7 @@ server {
} }
location @rewrite { location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1; rewrite ^ /index.php;
} }
location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7 location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7
@@ -87,6 +87,7 @@ server {
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|ico|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 "*"; add_header Access-Control-Allow-Origin "*";
add_header alt-svc 'h3=":443"; ma=86400'; add_header alt-svc 'h3=":443"; ma=86400';
try_files $uri @rewrite;
expires max; expires max;
access_log off; access_log off;
} }
@@ -94,4 +95,4 @@ server {
if (-f $request_filename) { if (-f $request_filename) {
break; break;
} }
} }

View File

@@ -1,9 +1,13 @@
#{"rootDirectory":"web","phpVersion":"8.1"} #{"rootDirectory":"web","phpVersion":"8.3"}
server { server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
listen 443 ssl http2; listen 443 quic;
listen [::]:443 ssl http2; listen 443 ssl;
listen [::]:443 quic;
listen [::]:443 ssl;
http2 on;
http3 off;
{{ssl_certificate_key}} {{ssl_certificate_key}}
{{ssl_certificate}} {{ssl_certificate}}
{{server_name}} {{server_name}}
@@ -13,7 +17,7 @@ server {
{{nginx_error_log}} {{nginx_error_log}}
if ($scheme != "https") { if ($scheme != "https") {
rewrite ^ https://$host$uri permanent; rewrite ^ https://$host$request_uri permanent;
} }
location ~ /.well-known { location ~ /.well-known {
@@ -29,6 +33,8 @@ server {
{{settings}} {{settings}}
include /etc/nginx/global_settings;
location ~ ^/sites/.*/files/styles/ { location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite; try_files $uri @rewrite;
} }
@@ -38,7 +44,7 @@ server {
} }
location @rewrite { location @rewrite {
rewrite ^/(.*)$ /index.php?q=$1; rewrite ^ /index.php;
} }
location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7 location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7
@@ -80,6 +86,8 @@ server {
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|ico|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 "*"; add_header Access-Control-Allow-Origin "*";
add_header alt-svc 'h3=":443"; ma=86400';
try_files $uri @rewrite;
expires max; expires max;
access_log off; access_log off;
} }
@@ -87,4 +95,4 @@ server {
if (-f $request_filename) { if (-f $request_filename) {
break; break;
} }
} }