Przeglądaj źródła

Update codeigniter.stpl

Alexandros Ioannides 5 lat temu
rodzic
commit
23b4af08b3

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

@@ -19,24 +19,41 @@ server {
 
 
     include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
     include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
 
 
+    location = /favicon.ico {
+        log_not_found off;
+        access_log off;
+    }
+
+    location = /robots.txt {
+        allow all;
+        log_not_found off;
+        access_log off;
+    }
+
+    location ~ /\.(?!well-known\/) {
+        deny all;
+        return 404;
+    }
+
+    location ~ /(application|system|README.md|CHANGELOG.md|LICENSE) {
+        deny all;
+        return 404;
+    }
+
     location / {
     location / {
         try_files $uri $uri/ /index.php;
         try_files $uri $uri/ /index.php;
-
-        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
-            expires     max;
+        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)$ {
+            expires 30d;
             fastcgi_hide_header "Set-Cookie";
             fastcgi_hide_header "Set-Cookie";
         }
         }
 
 
         location ~ [^/]\.php(/|$) {
         location ~ [^/]\.php(/|$) {
             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
-            if (!-f $document_root$fastcgi_script_name) {
-                return  404;
-            }
-
-            fastcgi_pass    %backend_lsnr%;
-            fastcgi_index   index.php;
-            include         /etc/nginx/fastcgi_params;
-            include     %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
+            try_files $uri =404;
+            fastcgi_pass %backend_lsnr%;
+            fastcgi_index index.php;
+            include /etc/nginx/fastcgi_params;
+            include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
         }
         }
     }
     }
 
 
@@ -44,17 +61,12 @@ server {
         alias   %home%/%user%/web/%domain%/document_errors/;
         alias   %home%/%user%/web/%domain%/document_errors/;
     }
     }
 
 
-    location ~ /\.(?!well-known\/) { 
-       deny all; 
-       return 404;
-    }    
-
     location /vstats/ {
     location /vstats/ {
         alias   %home%/%user%/web/%domain%/stats/;
         alias   %home%/%user%/web/%domain%/stats/;
         include %home%/%user%/web/%domain%/stats/auth.conf*;
         include %home%/%user%/web/%domain%/stats/auth.conf*;
     }
     }
 
 
-    include     /etc/nginx/conf.d/phpmyadmin.inc*;
-    include     /etc/nginx/conf.d/phppgadmin.inc*;
-    include     %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
+    include /etc/nginx/conf.d/phpmyadmin.inc*;
+    include /etc/nginx/conf.d/phppgadmin.inc*;
+    include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
 }
 }