Skip to content

Commit

Permalink
Correct NGINX downloading files instead of showing 404 for non-existi…
Browse files Browse the repository at this point in the history
…ng URL routes
  • Loading branch information
alextselegidis committed Jul 10, 2023
1 parent 5473544 commit a9e7cea
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ server {

access_log /var/log/nginx/application.access.log;

root /var/www/html/.;
root /var/www/html;

index index.php;
index index.php index.html;

# try to serve file directly, fallback to index.php

location / {
try_files $uri $uri/ /index.php$is_args$args =404;
try_files $uri $uri/ =404;
}

location ~ ^.+.php {
Expand All @@ -27,4 +27,8 @@ server {
fastcgi_buffer_size 32k;
include fastcgi_params;
}

location ~ /\.ht {
deny all;
}
}

0 comments on commit a9e7cea

Please sign in to comment.