diff --git a/v2-varnish/CakePHP/CakePHP 4 b/v2-varnish/CakePHP/CakePHP 4 new file mode 100755 index 0000000..97fe781 --- /dev/null +++ b/v2-varnish/CakePHP/CakePHP 4 @@ -0,0 +1,51 @@ +#{"rootDirectory":"webroot","phpVersion":"8.1"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/CodeIgniter/CodeIgniter 4 b/v2-varnish/CodeIgniter/CodeIgniter 4 new file mode 100755 index 0000000..9721f72 --- /dev/null +++ b/v2-varnish/CodeIgniter/CodeIgniter 4 @@ -0,0 +1,51 @@ +#{"rootDirectory":"public","phpVersion":"8.1"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Contao/Contao 4 b/v2-varnish/Contao/Contao 4 new file mode 100755 index 0000000..a47b29e --- /dev/null +++ b/v2-varnish/Contao/Contao 4 @@ -0,0 +1,69 @@ +#{"rootDirectory":"public","phpVersion":"8.0"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + location / { + index index.php; + try_files $uri @rewriteapp; + } + + location @rewriteapp { + rewrite ^(.*)$ /index.php/$1 last; + } + + location ~ ^/(app|app_dev|config|index|preview|install|contao-manager\.phar)\.php(/|$) { + include fastcgi_params; + fastcgi_intercept_errors on; + fastcgi_split_path_info ^(.+\.php)(/.*)$; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_param HTTPS $fastcgi_https; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + fastcgi_param PHP_VALUE "{{php_settings}}"; + } + + location = /favicon.ico { + log_not_found off; + access_log off; + } + + location = /robots.txt { + allow all; + log_not_found off; + access_log off; + try_files $uri /index.php$is_args$args; + } + + location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + try_files $uri $uri/ /index.php$is_args$args; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Drupal/Drupal 8 b/v2-varnish/Drupal/Drupal 8 new file mode 100755 index 0000000..e7fc8a7 --- /dev/null +++ b/v2-varnish/Drupal/Drupal 8 @@ -0,0 +1,88 @@ +#{"rootDirectory":"web","phpVersion":"8.0"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + location ~ (^|/)\. { + return 403; + } + + {{settings}} + + 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 ~ ^/update.php { + fastcgi_split_path_info ^(.+?\.php)(|/.*)$; + try_files $fastcgi_script_name =404; + include fastcgi_params; + fastcgi_intercept_errors on; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_param HTTPS $fastcgi_https; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + fastcgi_param PHP_VALUE "{{php_settings}}"; + } + + 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 $fastcgi_https; + 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|ico|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Drupal/Drupal 9 b/v2-varnish/Drupal/Drupal 9 new file mode 100755 index 0000000..add8c84 --- /dev/null +++ b/v2-varnish/Drupal/Drupal 9 @@ -0,0 +1,90 @@ +#{"rootDirectory":"web","phpVersion":"8.1"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + rewrite ^/core/authorize.php/core/authorize.php(.*)$ /core/authorize.php$1; + + location ~ (^|/)\. { + return 403; + } + + {{settings}} + + 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 ~ ^/update.php { + fastcgi_split_path_info ^(.+?\.php)(|/.*)$; + try_files $fastcgi_script_name =404; + include fastcgi_params; + fastcgi_intercept_errors on; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_param HTTPS $fastcgi_https; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + fastcgi_param PHP_VALUE "{{php_settings}}"; + } + + 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 $fastcgi_https; + 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|ico|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/FuelPHP/FuelPHP 1.8 b/v2-varnish/FuelPHP/FuelPHP 1.8 new file mode 100755 index 0000000..f3ee785 --- /dev/null +++ b/v2-varnish/FuelPHP/FuelPHP 1.8 @@ -0,0 +1,51 @@ +#{"rootDirectory":"public","phpVersion":"7.2"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Generic/Generic b/v2-varnish/Generic/Generic new file mode 100644 index 0000000..b9a32e9 --- /dev/null +++ b/v2-varnish/Generic/Generic @@ -0,0 +1,51 @@ +#{"rootDirectory":"","phpVersion":"8.1"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Joomla/Joomla 4 b/v2-varnish/Joomla/Joomla 4 new file mode 100755 index 0000000..7c2b560 --- /dev/null +++ b/v2-varnish/Joomla/Joomla 4 @@ -0,0 +1,51 @@ +#{"rootDirectory":"","phpVersion":"7.4"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Laminas/Laminas b/v2-varnish/Laminas/Laminas new file mode 100755 index 0000000..9721f72 --- /dev/null +++ b/v2-varnish/Laminas/Laminas @@ -0,0 +1,51 @@ +#{"rootDirectory":"public","phpVersion":"8.1"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Laravel/Laravel 8 b/v2-varnish/Laravel/Laravel 8 new file mode 100755 index 0000000..3f432d0 --- /dev/null +++ b/v2-varnish/Laravel/Laravel 8 @@ -0,0 +1,51 @@ +#{"rootDirectory":"public","phpVersion":"7.4"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Laravel/Laravel 9 b/v2-varnish/Laravel/Laravel 9 new file mode 100755 index 0000000..9721f72 --- /dev/null +++ b/v2-varnish/Laravel/Laravel 9 @@ -0,0 +1,51 @@ +#{"rootDirectory":"public","phpVersion":"8.1"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Magento/Magento 2 b/v2-varnish/Magento/Magento 2 new file mode 100755 index 0000000..13d9547 --- /dev/null +++ b/v2-varnish/Magento/Magento 2 @@ -0,0 +1,73 @@ +#{"rootDirectory":"pub","phpVersion":"8.1"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + location ~/media/ { + add_header Access-Control-Allow-Origin "*"; + expires max; + try_files $uri $uri/ /get.php$is_args$args; + } + + location /static/ { + add_header Access-Control-Allow-Origin "*"; + location ~ ^/static/version { + rewrite ^/static/(version\d*/)?(.*)$ /static/$2 last; + } + location ~* \.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2|html|json)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + if (!-f $request_filename) { + rewrite ^/static/(version\d*/)?(.*)$ /static.php?resource=$2 last; + rewrite ^/static/(.*)$ /static.php?resource=$1 last; + } + } + } + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Matomo/Matomo 4 b/v2-varnish/Matomo/Matomo 4 new file mode 100755 index 0000000..919f696 --- /dev/null +++ b/v2-varnish/Matomo/Matomo 4 @@ -0,0 +1,51 @@ +#{"rootDirectory":"","phpVersion":"8.0"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Mautic/Mautic 4 b/v2-varnish/Mautic/Mautic 4 new file mode 100755 index 0000000..92a474f --- /dev/null +++ b/v2-varnish/Mautic/Mautic 4 @@ -0,0 +1,67 @@ +#{"rootDirectory":"","phpVersion":"7.4"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + location ~ ^/(config|tmp|core|lang) { + return 403; + } + + location ~ /.ht { + return 403; + } + + location ~ (.*).gif { + try_files $uri /index.php?$args; + } + + location ~ (.*).js { + try_files $uri /index.php?$args; + } + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Moodle/Moodle 4 b/v2-varnish/Moodle/Moodle 4 new file mode 100755 index 0000000..0840514 --- /dev/null +++ b/v2-varnish/Moodle/Moodle 4 @@ -0,0 +1,53 @@ +#{"rootDirectory":"","phpVersion":"7.3"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + rewrite ^/(.*.php)(/)(.*)$ /$1?file=/$3 last; + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Neos/Neos 8 b/v2-varnish/Neos/Neos 8 new file mode 100755 index 0000000..60f9d03 --- /dev/null +++ b/v2-varnish/Neos/Neos 8 @@ -0,0 +1,54 @@ +#{"rootDirectory":"Web","phpVersion":"8.1"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + fastcgi_param FLOW_CONTEXT Development; + #fastcgi_param FLOW_CONTEXT Production; + fastcgi_param FLOW_REWRITEURLS 1; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Nextcloud/Nextcloud 25 b/v2-varnish/Nextcloud/Nextcloud 25 new file mode 100644 index 0000000..6a5ed23 --- /dev/null +++ b/v2-varnish/Nextcloud/Nextcloud 25 @@ -0,0 +1,118 @@ +#{"rootDirectory":"","phpVersion":"8.1"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + # set max upload size and increase upload timeout: + client_max_body_size 512M; + client_body_timeout 300s; + fastcgi_buffers 64 4K; + + # Enable gzip but do not remove ETag headers + gzip on; + gzip_vary on; + gzip_comp_level 4; + gzip_min_length 256; + gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; + gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/wasm application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; + + # Remove X-Powered-By, which is an information leak + fastcgi_hide_header X-Powered-By; + + add_header Permissions-Policy "geolocation=(),midi=(),sync-xhr=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=(self),payment=()"; + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload;"; + + location ^~ /.well-known { + # The rules in this block are an adaptation of the rules + # in `.htaccess` that concern `/.well-known`. + location = /.well-known/carddav { return 301 /remote.php/dav/; } + location = /.well-known/caldav { return 301 /remote.php/dav/; } + location /.well-known/acme-challenge { try_files $uri $uri/ =404; } + location /.well-known/pki-validation { try_files $uri $uri/ =404; } + # Let Nextcloud's API for `/.well-known` URIs handle all other + # requests by passing them to the front-end controller. + return 301 /index.php$request_uri; + } + + # Remove "#" to enable the push service. Please note that this must be set up before activation. + #location /push/ { + # proxy_pass http://localhost:7867/; + # proxy_http_version 1.1; + # proxy_set_header Upgrade $http_upgrade; + # proxy_set_header Connection "Upgrade"; + # proxy_set_header Host $host; + # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + #} + + {{settings}} + + location / { + rewrite ^ /index.php; + } + + location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ { + deny all; + } + + location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) { + deny all; + } + + try_files $uri $uri/ /index.php?$args; + index index.php index.html; + + location ~ ^\/(?:index|setup-nextcloud|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) { + include fastcgi_params; + fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; + set $path_info $fastcgi_path_info; + try_files $fastcgi_script_name =404; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $path_info; + fastcgi_param front_controller_active true; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + fastcgi_param PHP_VALUE "{{php_settings}}"; + } + + location ~ ^\/(?:updater|oc[ms]-provider)(?:$|\/) { + try_files $uri/ =404; + index index.php; + } + + location ~ \.(?:css|js|woff2?|svg|gif|map)$ { + try_files $uri /index.php$request_uri; + add_header Cache-Control "public, max-age=15778463"; + add_header X-Content-Type-Options nosniff; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Robots-Tag none; + add_header X-Download-Options noopen; + add_header X-Permitted-Cross-Domain-Policies none; + add_header Referrer-Policy no-referrer; + # Optional: Don't log access to assets + access_log off; + } + + location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap)$ { + try_files $uri /index.php$request_uri; + # Optional: Don't log access to other assets + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Nodejs/Nodejs b/v2-varnish/Nodejs/Nodejs new file mode 100755 index 0000000..8602a06 --- /dev/null +++ b/v2-varnish/Nodejs/Nodejs @@ -0,0 +1,48 @@ +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + index index.html; + + location / { + proxy_pass http://127.0.0.1:{{app_port}}/; + proxy_http_version 1.1; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Host $http_host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_pass_request_headers on; + proxy_max_temp_file_size 0; + proxy_connect_timeout 900; + proxy_send_timeout 900; + proxy_read_timeout 900; + proxy_buffer_size 128k; + proxy_buffers 4 256k; + proxy_busy_buffers_size 256k; + proxy_temp_file_write_size 256k; + } +} \ No newline at end of file diff --git a/v2-varnish/OroCRM/OroCRM 5.0 b/v2-varnish/OroCRM/OroCRM 5.0 new file mode 100755 index 0000000..eece16f --- /dev/null +++ b/v2-varnish/OroCRM/OroCRM 5.0 @@ -0,0 +1,51 @@ +#{"rootDirectory":"public","phpVersion":"8.1"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + # add_header Access-Control-Allow-Origin "*"; + # expires max; + # access_log off; + #} + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/OroCommerce/OroCommerce 5.0 b/v2-varnish/OroCommerce/OroCommerce 5.0 new file mode 100755 index 0000000..eece16f --- /dev/null +++ b/v2-varnish/OroCommerce/OroCommerce 5.0 @@ -0,0 +1,51 @@ +#{"rootDirectory":"public","phpVersion":"8.1"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + # add_header Access-Control-Allow-Origin "*"; + # expires max; + # access_log off; + #} + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/PrestaShop/PrestaShop 1.7 b/v2-varnish/PrestaShop/PrestaShop 1.7 new file mode 100755 index 0000000..ae0da4d --- /dev/null +++ b/v2-varnish/PrestaShop/PrestaShop 1.7 @@ -0,0 +1,55 @@ +#{"rootDirectory":"","phpVersion":"7.3"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + #if ($scheme != "https") { + # rewrite ^ https://$host$uri permanent; + #} + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + location /admin-dev/ { + try_files $uri $uri/ /admin-dev/index.php?$args; + } + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Python/Python b/v2-varnish/Python/Python new file mode 100755 index 0000000..e92ed93 --- /dev/null +++ b/v2-varnish/Python/Python @@ -0,0 +1,65 @@ +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + index index.html; + + location /uwsgi { + include uwsgi_params; + uwsgi_read_timeout 3600; + #uwsgi_pass unix:///run/uwsgi/app/weblate/socket; + uwsgi_pass 127.0.0.1:{{app_port}}; + } + + location / { + proxy_pass http://127.0.0.1:{{app_port}}/; + proxy_http_version 1.1; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Server $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Host $http_host; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_pass_request_headers on; + proxy_max_temp_file_size 0; + proxy_connect_timeout 900; + proxy_send_timeout 900; + proxy_read_timeout 900; + proxy_buffer_size 128k; + proxy_buffers 4 256k; + proxy_busy_buffers_size 256k; + proxy_temp_file_write_size 256k; + } + + location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log on; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Shopware/Shopware 6 b/v2-varnish/Shopware/Shopware 6 new file mode 100755 index 0000000..15adeff --- /dev/null +++ b/v2-varnish/Shopware/Shopware 6 @@ -0,0 +1,55 @@ +#{"rootDirectory":"public","phpVersion":"8.0"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + location /recovery/install/ { + try_files $uri $uri/ /recovery/install/index.php?$args; + } + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Slim/Slim 4 b/v2-varnish/Slim/Slim 4 new file mode 100755 index 0000000..3f432d0 --- /dev/null +++ b/v2-varnish/Slim/Slim 4 @@ -0,0 +1,51 @@ +#{"rootDirectory":"public","phpVersion":"7.4"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Static/Static b/v2-varnish/Static/Static new file mode 100644 index 0000000..14795e3 --- /dev/null +++ b/v2-varnish/Static/Static @@ -0,0 +1,36 @@ +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + index index.html; + + location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Symfony/Symfony 5 b/v2-varnish/Symfony/Symfony 5 new file mode 100755 index 0000000..9721f72 --- /dev/null +++ b/v2-varnish/Symfony/Symfony 5 @@ -0,0 +1,51 @@ +#{"rootDirectory":"public","phpVersion":"8.1"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Symfony/Symfony 6 b/v2-varnish/Symfony/Symfony 6 new file mode 100755 index 0000000..9721f72 --- /dev/null +++ b/v2-varnish/Symfony/Symfony 6 @@ -0,0 +1,51 @@ +#{"rootDirectory":"public","phpVersion":"8.1"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/TYPO3/TYPO3 11 b/v2-varnish/TYPO3/TYPO3 11 new file mode 100755 index 0000000..bd3fa06 --- /dev/null +++ b/v2-varnish/TYPO3/TYPO3 11 @@ -0,0 +1,55 @@ +#{"rootDirectory":"public","phpVersion":"8.0"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + location /typo3/ { + try_files $uri $uri/ /typo3/index.php?$args; + } + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/WHMCS/WHMCS b/v2-varnish/WHMCS/WHMCS new file mode 100644 index 0000000..357a3f6 --- /dev/null +++ b/v2-varnish/WHMCS/WHMCS @@ -0,0 +1,70 @@ +#{"rootDirectory":"","phpVersion":"7.4"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + try_files $uri $uri/ /index.php?$args; + index index.php index.html; + + location / { + error_page 404 /index.php?$query_string; + try_files $uri $uri/ /index.php?$query_string; + } + + location ~ /admin/(client!\.php|search|apps|billing|setup|user|services|addons|domains|utilities|help!\.php|help/license|image/(recent|upload))/?(.*)$ { + rewrite ^/(.*)$ /admin/index.php?rp=/admin/$1/$2; + } + + location ~ /(login|password|account|store|download|knowledgebase|announcements|clientarea/ssl-certificates|user/(profile|password|security)|cart/(domain/renew)|images/kb)/?(.*)$ { + rewrite ^/(.*)$ /index.php?rp=/$1/$2; + } + + ## WHMCS Security Advisory 2020-01-28 (https://docs.whmcs.com/Security_Advisory_2020-01-28) + location ^~ /vendor/ { + deny all; + return 403; + } + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/WooCommerce/WooCommerce b/v2-varnish/WooCommerce/WooCommerce new file mode 100755 index 0000000..919f696 --- /dev/null +++ b/v2-varnish/WooCommerce/WooCommerce @@ -0,0 +1,51 @@ +#{"rootDirectory":"","phpVersion":"8.0"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/WordPress/WordPress b/v2-varnish/WordPress/WordPress new file mode 100644 index 0000000..919f696 --- /dev/null +++ b/v2-varnish/WordPress/WordPress @@ -0,0 +1,51 @@ +#{"rootDirectory":"","phpVersion":"8.0"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/Yii/Yii 2 b/v2-varnish/Yii/Yii 2 new file mode 100755 index 0000000..16ef8bd --- /dev/null +++ b/v2-varnish/Yii/Yii 2 @@ -0,0 +1,51 @@ +#{"rootDirectory":"web","phpVersion":"7.4"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + 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 $fastcgi_https; + 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)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file diff --git a/v2-varnish/ownCloud/OwnCloud 10 b/v2-varnish/ownCloud/OwnCloud 10 new file mode 100755 index 0000000..1b52c48 --- /dev/null +++ b/v2-varnish/ownCloud/OwnCloud 10 @@ -0,0 +1,99 @@ +#{"rootDirectory":"","phpVersion":"7.4"} +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + add_header Strict-Transport-Security "max-age=15552000; includeSubDomains"; + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + location = /.well-known/carddav { + return 301 $scheme://$host/remote.php/dav; + } + + location = /.well-known/caldav { + return 301 $scheme://$host/remote.php/dav; + } + + error_page 403 /core/templates/403.php; + error_page 404 /core/templates/404.php; + + location / { + rewrite ^ /index.php$uri; + } + + location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ { + return 404; + } + + location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { + return 404; + } + + try_files $uri $uri/ /index.php?$args; + index index.php index.html; + + location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\.php(?:$|/) { + include fastcgi_params; + fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; + set $path_info $fastcgi_path_info; + try_files $fastcgi_script_name =404; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $path_info; + fastcgi_param front_controller_active true; + fastcgi_read_timeout 3600; + fastcgi_send_timeout 3600; + fastcgi_param HTTPS $fastcgi_https; + fastcgi_pass 127.0.0.1:{{php_fpm_port}}; + fastcgi_param PHP_VALUE "{{php_settings}}"; + } + + location ~ ^/(?:updater|ocs-provider)(?:$|/) { + try_files $uri $uri/ =404; + index index.php; + } + + location ~* \.(?:css|js)$ { + try_files $uri /index.php$uri$is_args$args; + add_header Cache-Control "public, max-age=7200"; + # Add headers to serve security related headers (It is intended to have those duplicated to the ones above) + # Before enabling Strict-Transport-Security headers please read into this topic first. + #add_header Strict-Transport-Security "max-age=15552000; includeSubDomains"; + add_header X-Content-Type-Options nosniff; + add_header X-Frame-Options "SAMEORIGIN"; + add_header X-XSS-Protection "1; mode=block"; + add_header X-Robots-Tag none; + add_header X-Download-Options noopen; + add_header X-Permitted-Cross-Domain-Policies none; + # Optional: Don't log access to assets + access_log off; + } + + location ~* \.(?:svg|gif|png|html|ttf|woff|woff2|ico|jpg|jpeg)$ { + try_files $uri /index.php$uri$is_args$args; + # Optional: Don't log access to other assets + access_log off; + } + + if (-f $request_filename) { + break; + } +} \ No newline at end of file