Skip to content

Commit 34c01a6

Browse files
author
Alexandros Ioannides
authored
Update laravel.stpl
1 parent da787da commit 34c01a6

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

install/deb/templates/web/nginx/php-fpm/laravel.stpl

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,41 +19,49 @@ server {
1919

2020
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
2121

22+
location = /favicon.ico {
23+
log_not_found off;
24+
access_log off;
25+
}
26+
27+
location = /robots.txt {
28+
allow all;
29+
log_not_found off;
30+
access_log off;
31+
}
32+
33+
location ~ /\.(?!well-known\/) {
34+
deny all;
35+
return 404;
36+
}
37+
2238
location / {
23-
try_files $uri $uri/ /index.php?$query_string;
24-
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
25-
expires max;
39+
try_files $uri $uri/ /index.php?$args;
40+
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
41+
expires 30d;
2642
fastcgi_hide_header "Set-Cookie";
2743
}
2844

2945
location ~ [^/]\.php(/|$) {
3046
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
31-
if (!-f $document_root$fastcgi_script_name) {
32-
return 404;
33-
}
34-
35-
fastcgi_pass %backend_lsnr%;
36-
fastcgi_index index.php;
47+
try_files $uri =404;
48+
fastcgi_pass %backend_lsnr%;
49+
fastcgi_index index.php;
3750
include /etc/nginx/fastcgi_params;
38-
include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
51+
include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
3952
}
4053
}
4154

4255
location /error/ {
4356
alias %home%/%user%/web/%domain%/document_errors/;
4457
}
4558

46-
location ~ /\.(?!well-known\/) {
47-
deny all;
48-
return 404;
49-
}
50-
5159
location /vstats/ {
5260
alias %home%/%user%/web/%domain%/stats/;
5361
include %home%/%user%/web/%domain%/stats/auth.conf*;
5462
}
5563

56-
include /etc/nginx/conf.d/phpmyadmin.inc*;
57-
include /etc/nginx/conf.d/phppgadmin.inc*;
58-
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
64+
include /etc/nginx/conf.d/phpmyadmin.inc*;
65+
include /etc/nginx/conf.d/phppgadmin.inc*;
66+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
5967
}

0 commit comments

Comments
 (0)