Skip to content

Commit

Permalink
Updated NGINX configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
turbo124 committed Jun 16, 2024
1 parent 536e21d commit 3517afe
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions source/en/self-host-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,25 +120,24 @@ gzip_types application/javascript application/x-javascript text/javascript
gzip_proxied no-cache no-store private expired auth;
gzip_min_length 1000;

location / {
try_files $uri $uri/ =404;
}

location ~* \.pdf$ {
add_header Cache-Control no-store;
# Allow access to index.php
location = /index.php {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
}

if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q= last;
# Block all other .php requests
location ~ \.php$ {
return 403;
}

location ~* /storage/.*\.php$ {
return 503;
}
location / {
try_files $uri $uri/ /index.php?$query_string;

location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
# Add your rewrite rule for non-existent files
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
}

location ~ /\.ht {
Expand Down

0 comments on commit 3517afe

Please sign in to comment.