From 810ff2401fee5d3565dc9eb60bed3418b29edf38 Mon Sep 17 00:00:00 2001 From: Stefan Wieczorek Date: Thu, 23 Mar 2023 10:28:42 +0100 Subject: [PATCH] . --- v2-varnish/CakePHP/CakePHP 4 | 56 +++++++++++----------- v2-varnish/CodeIgniter/CodeIgniter 4 | 54 ++++++++++----------- v2-varnish/Generic/Generic | 56 +++++++++++----------- v2-varnish/Laravel/Laravel 10 | 68 +++++++++++++-------------- v2-varnish/Laravel/Laravel 9 | 68 +++++++++++++-------------- v2-varnish/Slim/Slim 4 | 56 +++++++++++----------- v2-varnish/Symfony/Symfony 5 | 56 +++++++++++----------- v2-varnish/Symfony/Symfony 6 | 56 +++++++++++----------- v2-varnish/WooCommerce/WooCommerce | 70 ++++++++++++++-------------- v2-varnish/Yii/Yii 2 | 56 +++++++++++----------- 10 files changed, 298 insertions(+), 298 deletions(-) diff --git a/v2-varnish/CakePHP/CakePHP 4 b/v2-varnish/CakePHP/CakePHP 4 index 673216c..aea0cab 100755 --- a/v2-varnish/CakePHP/CakePHP 4 +++ b/v2-varnish/CakePHP/CakePHP 4 @@ -1,32 +1,4 @@ #{"rootDirectory":"webroot","phpVersion":"8.1","varnishCacheSettings":{"cacheLifetime":"604800","controller":"generic","excludes":["^\/admin\/"],"excludedParams":["__SID","noCache"]}} -server { - listen 8080; - listen [::]:8080; - {{server_name}} - {{root}} - - try_files $uri $uri/ /index.php?$args; - index index.php index.html; - - location ~ \.php$ { - include fastcgi_params; - fastcgi_intercept_errors on; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - try_files $uri =404; - fastcgi_read_timeout 3600; - fastcgi_send_timeout 3600; - fastcgi_param HTTPS "on"; - fastcgi_param SERVER_PORT 443; - fastcgi_pass 127.0.0.1:{{php_fpm_port}}; - fastcgi_param PHP_VALUE "{{php_settings}}"; - } - - if (-f $request_filename) { - break; - } -} - server { listen 80; listen [::]:80; @@ -75,6 +47,34 @@ server { access_log off; } + if (-f $request_filename) { + break; + } +} + +server { + listen 8080; + listen [::]:8080; + {{server_name}} + {{root}} + + try_files $uri $uri/ /index.php?$args; + index index.php index.html; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_intercept_errors on; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + try_files $uri =404; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_param HTTPS "on"; + fastcgi_param SERVER_PORT 443; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + fastcgi_param PHP_VALUE "{{php_settings}}"; + } + if (-f $request_filename) { break; } diff --git a/v2-varnish/CodeIgniter/CodeIgniter 4 b/v2-varnish/CodeIgniter/CodeIgniter 4 index e26932a..be84dce 100755 --- a/v2-varnish/CodeIgniter/CodeIgniter 4 +++ b/v2-varnish/CodeIgniter/CodeIgniter 4 @@ -1,31 +1,4 @@ #{"rootDirectory":"public","phpVersion":"8.1","varnishCacheSettings":{"cacheLifetime":"604800","controller":"generic","excludes":["^\/admin\/"],"excludedParams":["__SID","noCache"]}} -server { - listen 8080; - listen [::]:8080; - {{server_name}} - {{root}} - - try_files $uri $uri/ /index.php?$args; - index index.php index.html; - - location ~ \.php$ { - include fastcgi_params; - fastcgi_intercept_errors on; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - try_files $uri =404; - fastcgi_read_timeout 3600; - fastcgi_send_timeout 3600; - fastcgi_param HTTPS "on"; - fastcgi_pass 127.0.0.1:{{php_fpm_port}}; - fastcgi_param PHP_VALUE "{{php_settings}}"; - } - - if (-f $request_filename) { - break; - } -} - server { listen 80; listen [::]:80; @@ -74,6 +47,33 @@ server { access_log off; } + if (-f $request_filename) { + break; + } +} + +server { + listen 8080; + listen [::]:8080; + {{server_name}} + {{root}} + + try_files $uri $uri/ /index.php?$args; + index index.php index.html; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_intercept_errors on; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + try_files $uri =404; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_param HTTPS "on"; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + fastcgi_param PHP_VALUE "{{php_settings}}"; + } + if (-f $request_filename) { break; } diff --git a/v2-varnish/Generic/Generic b/v2-varnish/Generic/Generic index 5c4986b..ea7250c 100644 --- a/v2-varnish/Generic/Generic +++ b/v2-varnish/Generic/Generic @@ -1,32 +1,4 @@ #{"rootDirectory":"","phpVersion":"8.1","varnishCacheSettings":{"cacheLifetime":"604800","controller":"generic","excludes":["^\/admin\/"],"excludedParams":["__SID","noCache"]}} -server { - listen 8080; - listen [::]:8080; - {{server_name}} - {{root}} - - try_files $uri $uri/ /index.php?$args; - index index.php index.html; - - location ~ \.php$ { - include fastcgi_params; - fastcgi_intercept_errors on; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - try_files $uri =404; - fastcgi_read_timeout 3600; - fastcgi_send_timeout 3600; - fastcgi_param HTTPS "on"; - fastcgi_param SERVER_PORT 443; - fastcgi_pass 127.0.0.1:{{php_fpm_port}}; - fastcgi_param PHP_VALUE "{{php_settings}}"; - } - - if (-f $request_filename) { - break; - } -} - server { listen 80; listen [::]:80; @@ -75,6 +47,34 @@ server { access_log off; } + if (-f $request_filename) { + break; + } +} + +server { + listen 8080; + listen [::]:8080; + {{server_name}} + {{root}} + + try_files $uri $uri/ /index.php?$args; + index index.php index.html; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_intercept_errors on; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + try_files $uri =404; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_param HTTPS "on"; + fastcgi_param SERVER_PORT 443; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + fastcgi_param PHP_VALUE "{{php_settings}}"; + } + if (-f $request_filename) { break; } diff --git a/v2-varnish/Laravel/Laravel 10 b/v2-varnish/Laravel/Laravel 10 index 67dd8fd..b3d268d 100755 --- a/v2-varnish/Laravel/Laravel 10 +++ b/v2-varnish/Laravel/Laravel 10 @@ -1,38 +1,4 @@ #{"rootDirectory":"public","phpVersion":"8.1","varnishCacheSettings":{"cacheLifetime":"604800","controller":"generic","excludes":["^\/admin\/"],"excludedParams":["__SID","noCache"]}} -server { - listen 8080; - listen [::]:8080; - {{server_name}} - {{root}} - - try_files $uri $uri/ /index.php?$args; - index index.php index.html; - - location ~ \.php$ { - include fastcgi_params; - fastcgi_intercept_errors on; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - try_files $uri =404; - fastcgi_read_timeout 3600; - fastcgi_send_timeout 3600; - fastcgi_param HTTPS "on"; - fastcgi_param SERVER_PORT 443; - fastcgi_pass 127.0.0.1:{{php_fpm_port}}; - 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|map)$ { - add_header Access-Control-Allow-Origin "*"; - expires max; - access_log off; - } - - if (-f $request_filename) { - break; - } -} - server { listen 80; listen [::]:80; @@ -81,6 +47,40 @@ server { access_log off; } + if (-f $request_filename) { + break; + } +} + +server { + listen 8080; + listen [::]:8080; + {{server_name}} + {{root}} + + try_files $uri $uri/ /index.php?$args; + index index.php index.html; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_intercept_errors on; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + try_files $uri =404; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_param HTTPS "on"; + fastcgi_param SERVER_PORT 443; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + 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|map)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + if (-f $request_filename) { break; } diff --git a/v2-varnish/Laravel/Laravel 9 b/v2-varnish/Laravel/Laravel 9 index 67dd8fd..b3d268d 100755 --- a/v2-varnish/Laravel/Laravel 9 +++ b/v2-varnish/Laravel/Laravel 9 @@ -1,38 +1,4 @@ #{"rootDirectory":"public","phpVersion":"8.1","varnishCacheSettings":{"cacheLifetime":"604800","controller":"generic","excludes":["^\/admin\/"],"excludedParams":["__SID","noCache"]}} -server { - listen 8080; - listen [::]:8080; - {{server_name}} - {{root}} - - try_files $uri $uri/ /index.php?$args; - index index.php index.html; - - location ~ \.php$ { - include fastcgi_params; - fastcgi_intercept_errors on; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - try_files $uri =404; - fastcgi_read_timeout 3600; - fastcgi_send_timeout 3600; - fastcgi_param HTTPS "on"; - fastcgi_param SERVER_PORT 443; - fastcgi_pass 127.0.0.1:{{php_fpm_port}}; - 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|map)$ { - add_header Access-Control-Allow-Origin "*"; - expires max; - access_log off; - } - - if (-f $request_filename) { - break; - } -} - server { listen 80; listen [::]:80; @@ -81,6 +47,40 @@ server { access_log off; } + if (-f $request_filename) { + break; + } +} + +server { + listen 8080; + listen [::]:8080; + {{server_name}} + {{root}} + + try_files $uri $uri/ /index.php?$args; + index index.php index.html; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_intercept_errors on; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + try_files $uri =404; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_param HTTPS "on"; + fastcgi_param SERVER_PORT 443; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + 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|map)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + if (-f $request_filename) { break; } diff --git a/v2-varnish/Slim/Slim 4 b/v2-varnish/Slim/Slim 4 index cfe4cb2..651f8f4 100755 --- a/v2-varnish/Slim/Slim 4 +++ b/v2-varnish/Slim/Slim 4 @@ -1,32 +1,4 @@ #{"rootDirectory":"public","phpVersion":"7.4","varnishCacheSettings":{"cacheLifetime":"604800","controller":"generic","excludes":["^\/admin\/"],"excludedParams":["__SID","noCache"]}} -server { - listen 8080; - listen [::]:8080; - {{server_name}} - {{root}} - - try_files $uri $uri/ /index.php?$args; - index index.php index.html; - - location ~ \.php$ { - include fastcgi_params; - fastcgi_intercept_errors on; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - try_files $uri =404; - fastcgi_read_timeout 3600; - fastcgi_send_timeout 3600; - fastcgi_param HTTPS "on"; - fastcgi_param SERVER_PORT 443; - fastcgi_pass 127.0.0.1:{{php_fpm_port}}; - fastcgi_param PHP_VALUE "{{php_settings}}"; - } - - if (-f $request_filename) { - break; - } -} - server { listen 80; listen [::]:80; @@ -75,6 +47,34 @@ server { access_log off; } + if (-f $request_filename) { + break; + } +} + +server { + listen 8080; + listen [::]:8080; + {{server_name}} + {{root}} + + try_files $uri $uri/ /index.php?$args; + index index.php index.html; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_intercept_errors on; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + try_files $uri =404; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_param HTTPS "on"; + fastcgi_param SERVER_PORT 443; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + fastcgi_param PHP_VALUE "{{php_settings}}"; + } + if (-f $request_filename) { break; } diff --git a/v2-varnish/Symfony/Symfony 5 b/v2-varnish/Symfony/Symfony 5 index c25ebdd..b322285 100755 --- a/v2-varnish/Symfony/Symfony 5 +++ b/v2-varnish/Symfony/Symfony 5 @@ -1,32 +1,4 @@ #{"rootDirectory":"public","phpVersion":"8.1","varnishCacheSettings":{"cacheLifetime":"604800","controller":"generic","excludes":["^\/admin\/"],"excludedParams":["__SID","noCache"]}} -server { - listen 8080; - listen [::]:8080; - {{server_name}} - {{root}} - - try_files $uri $uri/ /index.php?$args; - index index.php index.html; - - location ~ \.php$ { - include fastcgi_params; - fastcgi_intercept_errors on; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - try_files $uri =404; - fastcgi_read_timeout 3600; - fastcgi_send_timeout 3600; - fastcgi_param HTTPS "on"; - fastcgi_param SERVER_PORT 443; - fastcgi_pass 127.0.0.1:{{php_fpm_port}}; - fastcgi_param PHP_VALUE "{{php_settings}}"; - } - - if (-f $request_filename) { - break; - } -} - server { listen 80; listen [::]:80; @@ -75,6 +47,34 @@ server { access_log off; } + if (-f $request_filename) { + break; + } +} + +server { + listen 8080; + listen [::]:8080; + {{server_name}} + {{root}} + + try_files $uri $uri/ /index.php?$args; + index index.php index.html; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_intercept_errors on; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + try_files $uri =404; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_param HTTPS "on"; + fastcgi_param SERVER_PORT 443; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + fastcgi_param PHP_VALUE "{{php_settings}}"; + } + if (-f $request_filename) { break; } diff --git a/v2-varnish/Symfony/Symfony 6 b/v2-varnish/Symfony/Symfony 6 index c25ebdd..b322285 100755 --- a/v2-varnish/Symfony/Symfony 6 +++ b/v2-varnish/Symfony/Symfony 6 @@ -1,32 +1,4 @@ #{"rootDirectory":"public","phpVersion":"8.1","varnishCacheSettings":{"cacheLifetime":"604800","controller":"generic","excludes":["^\/admin\/"],"excludedParams":["__SID","noCache"]}} -server { - listen 8080; - listen [::]:8080; - {{server_name}} - {{root}} - - try_files $uri $uri/ /index.php?$args; - index index.php index.html; - - location ~ \.php$ { - include fastcgi_params; - fastcgi_intercept_errors on; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - try_files $uri =404; - fastcgi_read_timeout 3600; - fastcgi_send_timeout 3600; - fastcgi_param HTTPS "on"; - fastcgi_param SERVER_PORT 443; - fastcgi_pass 127.0.0.1:{{php_fpm_port}}; - fastcgi_param PHP_VALUE "{{php_settings}}"; - } - - if (-f $request_filename) { - break; - } -} - server { listen 80; listen [::]:80; @@ -75,6 +47,34 @@ server { access_log off; } + if (-f $request_filename) { + break; + } +} + +server { + listen 8080; + listen [::]:8080; + {{server_name}} + {{root}} + + try_files $uri $uri/ /index.php?$args; + index index.php index.html; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_intercept_errors on; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + try_files $uri =404; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_param HTTPS "on"; + fastcgi_param SERVER_PORT 443; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + fastcgi_param PHP_VALUE "{{php_settings}}"; + } + if (-f $request_filename) { break; } diff --git a/v2-varnish/WooCommerce/WooCommerce b/v2-varnish/WooCommerce/WooCommerce index b706842..0bbf964 100755 --- a/v2-varnish/WooCommerce/WooCommerce +++ b/v2-varnish/WooCommerce/WooCommerce @@ -1,39 +1,4 @@ #{"rootDirectory":"","phpVersion":"8.0","varnishCacheSettings":{"cacheLifetime":"604800","controller":"wordpress","excludes":["^\/my-account\/","\/cart\/","\/checkout\/","wp-login.php"],"excludedParams":["__SID","noCache"]}} -server { - listen 8080; - listen [::]:8080; - {{server_name}} - {{root}} - - try_files $uri $uri/ /index.php?$args; - index index.php index.html; - - location ~ \.php$ { - include fastcgi_params; - fastcgi_intercept_errors on; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - try_files $uri =404; - fastcgi_read_timeout 3600; - fastcgi_send_timeout 3600; - fastcgi_param HTTPS "on"; - fastcgi_param SERVER_PORT 443; - fastcgi_pass 127.0.0.1:{{php_fpm_port}}; - fastcgi_param PHP_VALUE "{{php_settings}}"; - } - - # WordPress Multisite Subdirectory - if (!-e $request_filename) { - rewrite /wp-admin$ https://$host$uri permanent; - rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last; - rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last; - } - - if (-f $request_filename) { - break; - } -} - server { listen 80; listen [::]:80; @@ -105,6 +70,41 @@ server { access_log off; } + if (-f $request_filename) { + break; + } +} + +server { + listen 8080; + listen [::]:8080; + {{server_name}} + {{root}} + + try_files $uri $uri/ /index.php?$args; + index index.php index.html; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_intercept_errors on; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + try_files $uri =404; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_param HTTPS "on"; + fastcgi_param SERVER_PORT 443; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + fastcgi_param PHP_VALUE "{{php_settings}}"; + } + + # WordPress Multisite Subdirectory + if (!-e $request_filename) { + rewrite /wp-admin$ https://$host$uri permanent; + rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last; + rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last; + } + if (-f $request_filename) { break; } diff --git a/v2-varnish/Yii/Yii 2 b/v2-varnish/Yii/Yii 2 index 9585d0c..f89c9fb 100755 --- a/v2-varnish/Yii/Yii 2 +++ b/v2-varnish/Yii/Yii 2 @@ -1,32 +1,4 @@ #{"rootDirectory":"web","phpVersion":"7.4","varnishCacheSettings":{"cacheLifetime":"604800","controller":"generic","excludes":["^\/admin\/"],"excludedParams":["__SID","noCache"]}} -server { - listen 8080; - listen [::]:8080; - {{server_name}} - {{root}} - - try_files $uri $uri/ /index.php?$args; - index index.php index.html; - - location ~ \.php$ { - include fastcgi_params; - fastcgi_intercept_errors on; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - try_files $uri =404; - fastcgi_read_timeout 3600; - fastcgi_send_timeout 3600; - fastcgi_param HTTPS "on"; - fastcgi_param SERVER_PORT 443; - fastcgi_pass 127.0.0.1:{{php_fpm_port}}; - fastcgi_param PHP_VALUE "{{php_settings}}"; - } - - if (-f $request_filename) { - break; - } -} - server { listen 80; listen [::]:80; @@ -75,6 +47,34 @@ server { access_log off; } + if (-f $request_filename) { + break; + } +} + +server { + listen 8080; + listen [::]:8080; + {{server_name}} + {{root}} + + try_files $uri $uri/ /index.php?$args; + index index.php index.html; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_intercept_errors on; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + try_files $uri =404; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_param HTTPS "on"; + fastcgi_param SERVER_PORT 443; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + fastcgi_param PHP_VALUE "{{php_settings}}"; + } + if (-f $request_filename) { break; }