Explorar el Código

Update nginx.dist.conf

Similar to the previous commit.
Visman hace 4 años
padre
commit
1609f54d7e
Se han modificado 1 ficheros con 18 adiciones y 10 borrados
  1. 18 10
      nginx.dist.conf

+ 18 - 10
nginx.dist.conf

@@ -14,6 +14,7 @@ server {
         log_not_found off;
 
         expires 1w;
+        etag off;
     }
 
     location = /robots.txt {
@@ -31,24 +32,27 @@ server {
         fastcgi_param SCRIPT_FILENAME $realpath_root/index.dist.php;
         fastcgi_param DOCUMENT_ROOT   $realpath_root;
 
-        fastcgi_pass unix:/var/run/php-fpm.sock;  # you need to set your values
+        fastcgi_pass php_upstream;                    # you need to set your values
+        #or fastcgi_pass unix:/var/run/php-fpm.sock;  # you need to set your values
     }
 
     location /js/ {
         location ~ ^(.+)\.v\.[0-9]+\.([^.\\/]++)$ {
             try_files $1.$2 =404;
 
-            expires 1y;
+            add_header Cache-Control "public,max-age=31536000,immutable";
+            etag off;
         }
 
         location ~ /\.ht {
             return 404;
         }
 
-        location ~ \.(css|js|gif|png|jpg|jpeg|webp)$ {
+        location ~ \.(css|js|gif|png|jpg|jpeg|webp|woff|woff2)$ {
             try_files $uri =404;
 
-            expires 1y;
+            add_header Cache-Control "public,max-age=31536000,immutable";
+            etag off;
         }
     }
 
@@ -56,17 +60,19 @@ server {
         location ~ ^(.+)\.v\.[0-9]+\.([^.\\/]++)$ {
             try_files $1.$2 =404;
 
-            expires 1y;
+            add_header Cache-Control "public,max-age=31536000,immutable";
+            etag off;
         }
 
         location ~ /\.ht {
             return 404;
         }
 
-        location ~ \.(css|js|gif|png|jpg|jpeg|webp)$ {
+        location ~ \.(css|js|gif|png|jpg|jpeg|webp|woff|woff2)$ {
             try_files $uri =404;
 
-            expires 1y;
+            add_header Cache-Control "public,max-age=31536000,immutable";
+            etag off;
         }
     }
 
@@ -74,17 +80,19 @@ server {
         location ~ ^(.+)\.v\.[0-9]+\.([^.\\/]++)$ {
             try_files $1.$2 =404;
 
-            expires 1y;
+            add_header Cache-Control "public,max-age=31536000,immutable";
+            etag off;
         }
 
         location ~ /\.ht {
             return 404;
         }
 
-        location ~ \.(css|js|gif|png|jpg|jpeg|webp)$ {
+        location ~ \.(css|js|gif|png|jpg|jpeg|webp|woff|woff2)$ {
             try_files $uri =404;
 
-            expires 1y;
+            add_header Cache-Control "public,max-age=31536000,immutable";
+            etag off;
         }
     }
 }