Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Deny php execution inside media, themes and plugins directories

Givanaf4c686fce49
diff --git a/.htaccess b/.htaccess
index 97cc56a..a4e1327 100755
--- a/.htaccess
+++ b/.htaccess
@@ -25,9 +25,21 @@ Options -Indexes -ExecCGI -Includes -MultiViews
DirectoryIndex index.php
</IfModule>
-#<IfModule mod_headers.c>
-#Header always set Content-Security-Policy "upgrade-insecure-requests;"
-#</IfModule>
+#pass the authorization header to php when running via php-fpm/proxy_fcgi,
+#otherwise rest/api authentication won't work
+<IfModule mod_setenvif.c>
+ SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
+</IfModule>
+
+#security headers
+<IfModule mod_headers.c>
+ #Header always set X-Frame-Options "SAMEORIGIN"
+ #Header always set X-Content-Type-Options "nosniff"
+ #Header always set Referrer-Policy "strict-origin-when-cross-origin"
+
+ #Header always set Content-Security-Policy "upgrade-insecure-requests;"
+ #Header always set Strict-Transport-Security "max-age=31536000"
+</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
@@ -36,6 +48,8 @@ RewriteBase /
# Redirect http to https
#RewriteCond %{HTTPS} !=on
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
+RewriteRule (^|/)\.(?!well-known) - [F,L]
+RewriteRule ^(config|system|storage|app|vendor)(/|$) - [F,L]
#page cache
RewriteCond %{REQUEST_METHOD} !=POST
@@ -60,27 +74,23 @@ RewriteRule ^ index.php [L]
<IfModule mod_headers.c>
Header unset ETag
- Header set Connection keep-alive
-
- <FilesMatch "\.(txt|xml|js)$">
- Header set Cache-Control "max-age=2592000"
- </FilesMatch>
- <FilesMatch "\.(css)$">
- Header set Cache-Control "max-age=2592000"
- </FilesMatch>
+ <FilesMatch "\.(txt|xml|json|js|css)$">
+ Header set Cache-Control "max-age=2592000, public"
+ </FilesMatch>
- <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$">
- Header set Cache-Control "max-age=2592000"
- </FilesMatch>
+ <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|docx|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$">
+ Header set Cache-Control "max-age=31536000, public, immutable"
+ </FilesMatch>
- <FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$">
- Header set Cache-Control "max-age=2592000"
- </FilesMatch>
+ <FilesMatch "\.(jpg|jpeg|png|gif|swf|webp|avif|svg|svgz)$">
+ Header set Cache-Control "max-age=31536000, public, immutable"
+ </FilesMatch>
- <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
- Header set Access-Control-Allow-Origin "*"
- </FilesMatch>
+ <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2)$">
+ Header set Cache-Control "max-age=31536000, public, immutable"
+ Header set Access-Control-Allow-Origin "*"
+ </FilesMatch>
</IfModule>
#FileETag None
@@ -88,34 +98,26 @@ RewriteRule ^ index.php [L]
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A2592000
-
- <FilesMatch "\.(txt|xml|js)$">
+
+ <FilesMatch "\.(txt|xml|json|js|css)$">
ExpiresDefault A2592000
</FilesMatch>
-
- <FilesMatch "\.(css)$">
- ExpiresDefault A2592000
+
+ <FilesMatch "\.(ico|pdf|avi|mov|ppt|doc|docx|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$">
+ ExpiresDefault A31536000
</FilesMatch>
-
- <FilesMatch "\.(ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$">
- ExpiresDefault A2592000
+
+ <FilesMatch "\.(jpg|jpeg|png|gif|swf|webp|avif|svg|svgz)$">
+ ExpiresDefault A31536000
</FilesMatch>
-
- <FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$">
- ExpiresDefault A2592000
+
+ <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2)$">
+ ExpiresDefault A31536000
</FilesMatch>
</IfModule>
-
-
#gzip to reduce response size
<IfModule mod_deflate.c>
- <IfModule mod_setenvif.c>
- <IfModule mod_headers.c>
- SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
- RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
- </IfModule>
- </IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE "application/atom+xml" \
"application/javascript" \
@@ -125,6 +127,7 @@ RewriteRule ^ index.php [L]
"application/rdf+xml" \
"application/rss+xml" \
"application/schema+json" \
+ "application/vnd.api+json" \
"application/vnd.geo+json" \
"application/vnd.ms-fontobject" \
"application/x-font-ttf" \
@@ -149,11 +152,13 @@ RewriteRule ^ index.php [L]
"text/x-component" \
"text/x-cross-domain-policy" \
"text/xml"
-
+
+ #don't compress already compressed formats
+ SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png|webp|avif|gz|zip|rar|bz2|7z|xz|mp[34]|webm|og[v g]|woff2?)$" no-gzip
</IfModule>
+
<IfModule mod_mime.c>
- AddEncoding gzip svgz
+ AddEncoding gzip svgz
</IfModule>
-
-</IfModule>
+</IfModule>
diff --git a/nginx-docker.conf b/nginx-docker.conf
index 1f796df..971e23d 100644
--- a/nginx-docker.conf
+++ b/nginx-docker.conf
@@ -1,6 +1,13 @@
+upstream php {
+ #server unix:/var/run/php/php-fpm.sock;
+ #server unix:/var/run/php/php8.6-fpm.sock; #debian/ubuntu versioned socket
+ #server unix:/var/run/php-fpm86/php-fpm.pid; #alpine
+ server 127.0.0.1:9000; #tcp
+}
+
server {
listen 0.0.0.0:80;
-
+
#listen 80 server;
#listen [::]:80 server;
#listen 443 ssl http2;
@@ -14,63 +21,69 @@ server {
#ssl_prefer_server_ciphers on;
#ssl_ciphers 'ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5';
- error_log /var/log/nginx/error.log;
- access_log /var/log/nginx/access.log;
-
+ #error_log /var/log/nginx/error.log;
+ #access_log /var/log/nginx/access.log;
+
+ #always use public folder as root for security
root /var/www/html/public;
- index index.php index.html;
- error_page 404 /index.php;
-
gzip on;
gzip_vary on;
- gzip_min_length 10240;
+ gzip_min_length 1024;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
- gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
+ gzip_types text/plain text/css application/json application/manifest+json application/javascript text/xml application/xml application/xml+rss application/rss+xml application/atom+xml text/javascript image/svg+xml;
#charset utf-8;
+ #security headers
add_header X-Frame-Options "SAMEORIGIN";
- add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
+ add_header X-XSS-Protection "1; mode=block";
+ add_header Referrer-Policy "strict-origin-when-cross-origin";
+
+ #hide the php version from responses
+ fastcgi_hide_header X-Powered-By;
+
+ #allow enough time for long running admin requests (imports, backups)
+ fastcgi_read_timeout 900;
set $skip_cache 0;
set $cache_uri $request_uri;
-
+ #urls with a query string should always go to php
if ($query_string != "") {
set $skip_cache 1;
- set $cache_uri null;
- }
+ set $cache_uri "";
+ }
- # Don't cache uris containing the following segments
+ #don't cache uris containing the following segments
if ($request_uri ~* "/admin/|/user/|/cart/|/feed/|index.php|sitemap(_index)?.xml") {
set $skip_cache 1;
- set $cache_uri null;
- }
+ set $cache_uri "";
+ }
- # Don't use the cache for logged in users or if products in cart
- if ($http_cookie ~* "nocache|cart|user") {
+ #don't use the cache for logged in users or if products are in cart
+ if ($http_cookie ~* "nocache|cart|user|admin") {
set $skip_cache 1;
- set $cache_uri null;
+ set $cache_uri "";
}
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $skip_cache 1;
set $cache_uri null;
- }
+ }
- #static files
- #error_page 404 /index.php;
- #error_page 404 /404.html;
+ index index.php index.html;
+ error_page 404 /index.php;
+ #static files
location = /favicon.ico {
- log_not_found off;
- access_log off;
+ log_not_found off;
+ access_log off;
}
#add domain to sitemaps for multisite
@@ -80,45 +93,66 @@ server {
try_files $uri /index.php$is_args$args;
}
- #static files
- location ~* "\.(?!php)([\w]{3,5})$" {
+ #deny hidden files except .well-known (acme challenges)
+ location ~ /\.(?!well-known).* {
+ deny all;
+ }
+
+ #static files
+ location ~* "\.(?!php)(\w{2,5})$" {
expires max;
log_not_found off;
- sendfile on;
+ access_log off;
+ sendfile on;
sendfile_max_chunk 1m;
+ tcp_nopush on;
fastcgi_hide_header "Set-Cookie";
- try_files $uri =404;
+ #try_files $uri =404;
}
-
+
location / {
- default_type text/html;
- index index.php index.html index.htm;
- try_files /page-cache/$host$cache_uri /page-cache/$host$cache_uri/index.html $uri $uri/ /index.php$is_args$args;
- #try_files $uri $uri/ /index.php$is_args$args;
+ default_type text/html;
+ index index.php index.html;
+ try_files /page-cache/$host$cache_uri /page-cache/$host$cache_uri/index.html $uri $uri/ /index.php$is_args$args;
+ #try_files $uri $uri/ /index.php$is_args$args;
- #cache debug
- #add_header "uri" $cache_uri;
+ #cache debug
+ #add_header "uri" $cache_uri;
#add_header "skip_cache" $skip_cache;
- location ~ /media/.+?\.php$ {
- deny all;
- }
+ location ~ /vadmin-.+/index\.php {
+ include fastcgi.conf;
+ fastcgi_pass php;
+ }
- location ~ \.php$ {
- # try_files $uri =404;
-
- #fastcgi_pass unix:/var/run/php-fpm83/php-fpm.pid;
- #fastcgi_pass php:9000;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- include fastcgi_params;
+ location = /admin/index.php {
+ include fastcgi.conf;
+ fastcgi_pass php;
+ }
+
+ location = /install/index.php {
+ include fastcgi.conf;
+ fastcgi_pass php;
+ }
+
+ location ~ \.php$ {
+ rewrite ^ /index.php last;
+ }
+
+ location = /index.php {
+ include fastcgi.conf;
+ fastcgi_pass php;
+ fastcgi_read_timeout 900;
+ include fastcgi_params;
+ #uncomment fastcgi_cache to enable fastcgi cache, this should not be necessary
+ #unless you set the path to a memory mapped location for even faster cache
+
+ #fastcgi_cache VCACHE;
+ #fastcgi_cache_bypass $skip_cache;
+ #fastcgi_no_cache $skip_cache;
+ #fastcgi_cache_valid 30m;
+ #add_header X-VCache $upstream_cache_status;
}
- }
-
- location ~ /\.(?!well-known).* {
- deny all;
}
}
diff --git a/nginx-live-nocache.conf b/nginx-live-nocache.conf
deleted file mode 100755
index b00ad34..0000000
--- a/nginx-live-nocache.conf
+++ /dev/null
@@ -1,78 +0,0 @@
-#replace vvveb with your website domain and folder
-#copy this file to /etc/nginx/sites-available/vvveb
-#sudo ln -s /etc/nginx/sites-available/vvveb /etc/nginx/sites-enabled/vvveb
-#this configuration does not support page cache for advanced configuration with page cache support use nginx.conf
-
-server {
- listen 80;
- listen [::]:80;
- #listen 443 ssl http2;
-
- server_name vvveb.com www.vvveb.com;
- root /var/www/vvveb/public;
-
- add_header X-Frame-Options "SAMEORIGIN";
- add_header X-XSS-Protection "1; mode=block";
- add_header X-Content-Type-Options "nosniff";
- add_header X-Powered-By "Vvveb";
-
- #ssl_certificate /etc/letsencrypt/live/vvveb.com/fullchain.pem;
- #ssl_certificate_key /etc/letsencrypt/live/vvveb.com/privkey.pem;
-
- index index.html index.htm index.php;
-
- gzip on;
- gzip_vary on;
- gzip_min_length 10240;
- gzip_proxied any;
- gzip_comp_level 6;
- gzip_buffers 16 8k;
- gzip_http_version 1.1;
- gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
-
- #charset utf-8;
-
- add_header X-Frame-Options "SAMEORIGIN";
- add_header X-XSS-Protection "1; mode=block";
- add_header X-Content-Type-Options "nosniff";
-
- #add domain to sitemaps for multisite
- location = /robots.txt {
- log_not_found off;
- access_log off;
- try_files $uri /index.php$is_args$args;
- }
-
- #static files
- location ~* "\.(?!php)([\w]{3,5})$" {
- expires max;
- log_not_found off;
- sendfile on;
- sendfile_max_chunk 1m;
- fastcgi_hide_header "Set-Cookie";
- }
-
- location / {
- try_files $uri $uri/ /index.php?$query_string;
- }
-
- location = /favicon.ico { access_log off; log_not_found off; }
-
- error_page 404 /index.php;
-
- location ~ /media/.+?\.php$ {
- deny all;
- }
-
- location ~ \.php$ {
- #fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
- include fastcgi.conf;
- fastcgi_pass php;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
- }
-
- location ~ /\.(?!well-known).* {
- deny all;
- }
-}
diff --git a/nginx-live.conf b/nginx-live.conf
index 7679695..df1f8ab 100755
--- a/nginx-live.conf
+++ b/nginx-live.conf
@@ -1,92 +1,120 @@
-#replace /var/www/vvveb/public with your vvveb website public folder and set server_name for your domain
-#copy this file to /etc/nginx/sites-available/vvveb
-#sudo ln -s /etc/nginx/sites-available/vvveb /etc/nginx/sites-enabled/vvveb
-# or for apline linux /etc/nginx/httpd.d/default.conf
+# Vvveb nginx configuration
+#
+# Setup:
+# 1. replace /var/www/vvveb/public with your vvveb website public folder
+# 2. replace vvveb.com with your domain
+# 3. copy this file to /etc/nginx/sites-available/vvveb
+# 4. sudo ln -s /etc/nginx/sites-available/vvveb /etc/nginx/sites-enabled/vvveb
+# or for apline linux /etc/nginx/httpd.d/default.conf
+# 5. sudo nginx -t && sudo systemctl reload nginx
upstream php {
server unix:/var/run/php/php-fpm.sock;
- #server unix:/var/run/php-fpm82/php-fpm.pid;#alpine
- #server 127.0.0.1:9000;
-}
-
-upstream php81 {
- server unix:/var/run/php/php8.1-fpm.sock;
- #server 127.0.0.1:9000;
+ #server unix:/var/run/php/php8.6-fpm.sock; #debian/ubuntu versioned socket
+ #server unix:/var/run/php-fpm86/php-fpm.pid; #alpine
+ #server 127.0.0.1:9000; #tcp
}
-upstream php82 {
- server unix:/var/run/php/php8.2-fpm.sock;
- server unix:/var/run/php-fpm82.pid;#alpine
+upstream php86 {
+ server unix:/var/run/php/php8.6-fpm.sock;
+ #server unix:/var/run/php-fpm86.pid;#alpine
#server 127.0.0.1:9000;
}
-upstream php74 {
- server unix:/var/run/php/php7.4-fpm.sock;
- #server 127.0.0.1:9000;
-}
#use fastcgi cache if you want an even faster cache by mapping to memory otherwise leave it disabled to use the default try_files file cache
-fastcgi_cache_path /var/run/nginx-vvveb_cache levels=1:2 keys_zone=VCACHE:100m inactive=30m;
-fastcgi_cache_key "$scheme$request_method$host$request_uri";
-fastcgi_cache_use_stale error timeout invalid_header http_500;
-
+#fastcgi_cache_path /var/run/nginx-vvveb_cache levels=1:2 keys_zone=VCACHE:100m inactive=30m;
+#fastcgi_cache_key "$scheme$request_method$host$request_uri";
+#fastcgi_cache_use_stale error timeout invalid_header http_500;
server {
#always use public folder as root for security
- root /var/www/vvveb/public;
- #replace vvveb.net with your domain
- #server_name *.vvveb.net vvveb.net;
+ root /var/www/vvveb/public;
+
+ #replace vvveb.com with your domain
+ server_name *.vvveb.com vvveb.com;
+
+ #don't advertise the nginx version
+ server_tokens off;
+
+ #max upload size, keep in sync with php.ini upload_max_filesize/post_max_size
+ client_max_body_size 64m;
+
+ #listen 80;
+ #listen [::]:80;
- #listen 80 server;
- #listen [::]:80 server;
- #listen 443 ssl http2;
- #listen [::]:443 ssl http2;
+ #listen 443 ssl;
+ #listen [::]:443 ssl;
+ #http2 on; #nginx >= 1.25.1, on older versions use "listen 443 ssl http2;"
#ssl_certificate /etc/letsencrypt/live/vvveb.com/fullchain.pem;
#ssl_certificate_key /etc/letsencrypt/live/vvveb.com/privkey.pem;
+
#ssl_session_cache shared:SSL:20m;
- #ssl_session_timeout 10m;
- #ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- #ssl_prefer_server_ciphers on;
- #ssl_ciphers 'ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DH+3DES:!ADH:!AECDH:!MD5';
+ #ssl_session_timeout 1d;
+ #ssl_session_tickets off;
+
+ #disable deprecated protocols, keep only tls 1.2 and 1.3
+ #ssl_protocols TLSv1.2 TLSv1.3;
+ #ssl_prefer_server_ciphers off;
+ #mozilla intermediate cipher suite (tls 1.2 ciphers, tls 1.3 suites are used automatically)
+ #ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384';
+
+ #ocsp stapling
+ #ssl_stapling on;
+ #ssl_stapling_verify on;
+
+ #enable after confirming https works, avoid on shared subdomains (include subdomains optional)
+ #add_header Strict-Transport-Security "max-age=31536000" always;
+
+ #error_log /var/log/nginx/error.log;
+ #access_log /var/log/nginx/access.log;
- #error_log /var/log/nginx/error.log debug;
-
gzip on;
gzip_vary on;
- gzip_min_length 10240;
+ gzip_min_length 1024;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
- gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
+ gzip_types text/plain text/css application/json application/manifest+json application/javascript text/xml application/xml application/xml+rss application/rss+xml application/atom+xml text/javascript image/svg+xml;
#charset utf-8;
+ #security headers
+ #note: nginx replaces all inherited add_header directives with local ones,
+ #so if you add any add_header directive inside a location below remember to copy these
add_header X-Frame-Options "SAMEORIGIN";
- add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
+ add_header X-XSS-Protection "1; mode=block";
+ add_header Referrer-Policy "strict-origin-when-cross-origin";
+
+ #hide the php version from responses
+ fastcgi_hide_header X-Powered-By;
+
+ #allow enough time for long running admin requests (imports, backups)
+ fastcgi_read_timeout 900;
set $skip_cache 0;
set $cache_uri $request_uri;
-
+ #urls with a query string should always go to php
if ($query_string != "") {
set $skip_cache 1;
- set $cache_uri null;
+ set $cache_uri "";
}
- # Don't cache uris containing the following segments
+ #don't cache uris containing the following segments
if ($request_uri ~* "/admin/|/user/|/cart/|/feed/|index.php|sitemap(_index)?.xml") {
set $skip_cache 1;
- set $cache_uri null;
- }
+ set $cache_uri "";
+ }
- # Don't use the cache for logged in users or if products in cart
- if ($http_cookie ~* "nocache|user|cart") {
+ #don't use the cache for logged in users or if products are in cart
+ if ($http_cookie ~* "nocache|cart|user|admin") {
set $skip_cache 1;
- set $cache_uri null;
+ set $cache_uri "";
}
# POST requests and urls with a query string should always go to PHP
@@ -95,60 +123,88 @@ server {
set $cache_uri null;
}
- #index index.html index.htm index.php;
- #error_page 404 /index.php;
- #error_page 404 /404.html;
+ index index.php index.html;
+ error_page 404 /index.php;
+
+ #static files
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
#add domain to sitemaps for multisite
location = /robots.txt {
log_not_found off;
access_log off;
try_files $uri /index.php$is_args$args;
- }
-
- #static files
- location ~* "\.(?!php)([\w]{3,5})$" {
+ }
+
+ #deny hidden files except .well-known (acme challenges)
+ #must come before the static files location: regex locations match in
+ #file order and the static pattern would otherwise serve dotfiles like
+ #.env or .user.ini whose extension happens to be 2-5 chars long
+ location ~ /\.(?!well-known).* {
+ deny all;
+ }
+
+ #static files, served directly with far future caching
+ #{2,5} covers two letter extensions like .js too
+ #(?!php) leaves php files to the interpreter
+ location ~* "\.(?!php)(\w{2,5})$" {
expires max;
log_not_found off;
- sendfile on;
+ access_log off;
+ sendfile on;
sendfile_max_chunk 1m;
- fastcgi_hide_header "Set-Cookie";
+ tcp_nopush on;
+
+ #uncomment to serve only files that exist, otherwise missing files fall back to the app
+ #try_files $uri =404;
}
-
+
location / {
- default_type text/html;
- index index.php index.html index.htm;
+ default_type text/html;
+ index index.php index.html;
try_files /page-cache/$host$cache_uri /page-cache/$host$cache_uri/index.html $uri $uri/ /index.php$is_args$args;
#try_files $uri $uri/ /index.php$is_args$args;
- #cache debug
+ #cache debug, remember that adding add_header here disables the security headers above
#add_header "uri" $cache_uri;
#add_header "skip_cache" $skip_cache;
- }
- location ~ /media/.+?\.php$ {
- deny all;
- }
-
- location ~ \.php$ {
- #fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
- #fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
- include fastcgi.conf;
- fastcgi_pass php;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
-
- #uncomment fastcgi_cache to enable fastcgi cache, this should not be necessary
- #unless you set the path to a memory mapped location for even faster cache
-
- #fastcgi_cache VCACHE;
- fastcgi_cache_bypass $skip_cache;
- fastcgi_no_cache $skip_cache;
- fastcgi_cache_valid 30m;
- #add_header X-VCache $upstream_cache_status;
- }
-
- location ~ /\.(?!well-known).* {
- deny all;
+ location ~ /vadmin-.+/index\.php {
+ include fastcgi.conf;
+ fastcgi_pass php;
+ }
+
+ location = /admin/index.php {
+ include fastcgi.conf;
+ fastcgi_pass php;
+ }
+
+ location = /install/index.php {
+ include fastcgi.conf;
+ fastcgi_pass php;
+ }
+
+ #route all other php requests through the front controller
+ location ~ \.php$ {
+ rewrite ^ /index.php last;
+ }
+
+ location = /index.php {
+ include fastcgi.conf;
+ fastcgi_pass php;
+ fastcgi_read_timeout 900;
+ include fastcgi_params;
+ #uncomment fastcgi_cache to enable fastcgi cache, this should not be necessary
+ #unless you set the path to a memory mapped location for even faster cache
+
+ #fastcgi_cache VCACHE;
+ fastcgi_cache_bypass $skip_cache;
+ fastcgi_no_cache $skip_cache;
+ fastcgi_cache_valid 30m;
+ #add_header X-VCache $upstream_cache_status;
+ }
}
}