Skip to content

Commit da787da

Browse files
author
Alexandros Ioannides
authored
Update laravel.tpl
1 parent 8d0814f commit da787da

File tree

1 file changed

+29
-19
lines changed

1 file changed

+29
-19
lines changed

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

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,53 @@ server {
1111
access_log /var/log/nginx/domains/%domain%.log combined;
1212
access_log /var/log/nginx/domains/%domain%.bytes bytes;
1313
error_log /var/log/nginx/domains/%domain%.error.log error;
14-
14+
1515
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
16+
17+
location = /favicon.ico {
18+
log_not_found off;
19+
access_log off;
20+
}
21+
22+
location = /robots.txt {
23+
allow all;
24+
log_not_found off;
25+
access_log off;
26+
}
27+
28+
location ~ /\.(?!well-known\/) {
29+
deny all;
30+
return 404;
31+
}
32+
1633
location / {
17-
try_files $uri $uri/ /index.php?$query_string;
18-
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
19-
expires max;
34+
try_files $uri $uri/ /index.php?$args;
35+
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)$ {
36+
expires 30d;
2037
fastcgi_hide_header "Set-Cookie";
2138
}
2239

2340
location ~ [^/]\.php(/|$) {
2441
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
25-
if (!-f $document_root$fastcgi_script_name) {
26-
return 404;
27-
}
28-
29-
fastcgi_pass %backend_lsnr%;
30-
fastcgi_index index.php;
42+
try_files $uri =404;
43+
fastcgi_pass %backend_lsnr%;
44+
fastcgi_index index.php;
3145
include /etc/nginx/fastcgi_params;
32-
include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
46+
include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
47+
3348
}
3449
}
3550

3651
location /error/ {
3752
alias %home%/%user%/web/%domain%/document_errors/;
3853
}
3954

40-
location ~ /\.(?!well-known\/) {
41-
deny all;
42-
return 404;
43-
}
44-
4555
location /vstats/ {
4656
alias %home%/%user%/web/%domain%/stats/;
4757
include %home%/%user%/web/%domain%/stats/auth.conf*;
4858
}
4959

50-
include /etc/nginx/conf.d/phpmyadmin.inc*;
51-
include /etc/nginx/conf.d/phppgadmin.inc*;
52-
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
60+
include /etc/nginx/conf.d/phpmyadmin.inc*;
61+
include /etc/nginx/conf.d/phppgadmin.inc*;
62+
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
5363
}

0 commit comments

Comments
 (0)