Skip to content

Commit 23b4af0

Browse files
author
Alexandros Ioannides
authored
Update codeigniter.stpl
1 parent 4f5f074 commit 23b4af0

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

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

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,54 @@ 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+
38+
location ~ /(application|system|README.md|CHANGELOG.md|LICENSE) {
39+
deny all;
40+
return 404;
41+
}
42+
2243
location / {
2344
try_files $uri $uri/ /index.php;
24-
25-
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
26-
expires max;
45+
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)$ {
46+
expires 30d;
2747
fastcgi_hide_header "Set-Cookie";
2848
}
2949

3050
location ~ [^/]\.php(/|$) {
3151
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
32-
if (!-f $document_root$fastcgi_script_name) {
33-
return 404;
34-
}
35-
36-
fastcgi_pass %backend_lsnr%;
37-
fastcgi_index index.php;
38-
include /etc/nginx/fastcgi_params;
39-
include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
52+
try_files $uri =404;
53+
fastcgi_pass %backend_lsnr%;
54+
fastcgi_index index.php;
55+
include /etc/nginx/fastcgi_params;
56+
include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
4057
}
4158
}
4259

4360
location /error/ {
4461
alias %home%/%user%/web/%domain%/document_errors/;
4562
}
4663

47-
location ~ /\.(?!well-known\/) {
48-
deny all;
49-
return 404;
50-
}
51-
5264
location /vstats/ {
5365
alias %home%/%user%/web/%domain%/stats/;
5466
include %home%/%user%/web/%domain%/stats/auth.conf*;
5567
}
5668

57-
include /etc/nginx/conf.d/phpmyadmin.inc*;
58-
include /etc/nginx/conf.d/phppgadmin.inc*;
59-
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
69+
include /etc/nginx/conf.d/phpmyadmin.inc*;
70+
include /etc/nginx/conf.d/phppgadmin.inc*;
71+
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
6072
}

0 commit comments

Comments
 (0)