Forráskód Böngészése

Add file uploads 10/...

Visman 2 éve
szülő
commit
d8f5715d0f
3 módosított fájl, 26 hozzáadás és 5 törlés
  1. 1 1
      .dist.htaccess
  2. 23 3
      nginx.dist.conf
  3. 2 1
      public/.dist.htaccess

+ 1 - 1
.dist.htaccess

@@ -44,7 +44,7 @@ AddDefaultCharset UTF-8
 
 # Set Cache-Control header for caching statics
 <ifModule mod_headers.c>
-  <FilesMatch "\.(css|js|gif|png|jpg|jpeg|webp|woff|woff2)$">
+  <FilesMatch "\.(css|js|gif|png|jpg|jpeg|webp|avif|woff|woff2)$">
     Header set Cache-Control "public,max-age=31536000,immutable"
     Header unset ETag
   </FilesMatch>

+ 23 - 3
nginx.dist.conf

@@ -48,7 +48,7 @@ server {
             return 404;
         }
 
-        location ~ \.(css|js|gif|png|jpg|jpeg|webp|woff|woff2)$ {
+        location ~ \.(css|js|gif|png|jpg|jpeg|webp|avif|woff|woff2)$ {
             try_files $uri =404;
 
             add_header Cache-Control "public,max-age=31536000,immutable";
@@ -68,7 +68,7 @@ server {
             return 404;
         }
 
-        location ~ \.(css|js|gif|png|jpg|jpeg|webp|woff|woff2)$ {
+        location ~ \.(css|js|gif|png|jpg|jpeg|webp|avif|woff|woff2)$ {
             try_files $uri =404;
 
             add_header Cache-Control "public,max-age=31536000,immutable";
@@ -88,7 +88,27 @@ server {
             return 404;
         }
 
-        location ~ \.(css|js|gif|png|jpg|jpeg|webp|woff|woff2)$ {
+        location ~ \.(css|js|gif|png|jpg|jpeg|webp|avif|woff|woff2)$ {
+            try_files $uri =404;
+
+            add_header Cache-Control "public,max-age=31536000,immutable";
+            etag off;
+        }
+    }
+
+    location /upload/ {
+        location ~ ^(.+)\.v\.[0-9]+\.([^.\\/]++)$ {
+            try_files $1.$2 =404;
+
+            add_header Cache-Control "public,max-age=31536000,immutable";
+            etag off;
+        }
+
+        location ~ /\.ht {
+            return 404;
+        }
+
+        location ~ \.(css|js|gif|png|jpg|jpeg|webp|avif|woff|woff2)$ {
             try_files $uri =404;
 
             add_header Cache-Control "public,max-age=31536000,immutable";

+ 2 - 1
public/.dist.htaccess

@@ -16,6 +16,7 @@ AddDefaultCharset UTF-8
   RewriteCond %{REQUEST_URI} !^/style/
   RewriteCond %{REQUEST_URI} !^/img/
   RewriteCond %{REQUEST_URI} !^/js/
+  RewriteCond %{REQUEST_URI} !^/upload/
   RewriteCond %{REQUEST_URI} !^/favicon\.ico$
   RewriteCond %{REQUEST_URI} !^/robots\.txt$
   RewriteRule . index.php [L]
@@ -36,7 +37,7 @@ AddDefaultCharset UTF-8
 
 # Set Cache-Control header for caching statics
 <ifModule mod_headers.c>
-  <FilesMatch "\.(css|js|gif|png|jpg|jpeg|webp|woff|woff2)$">
+  <FilesMatch "\.(css|js|gif|png|jpg|jpeg|webp|avif|woff|woff2)$">
     Header set Cache-Control "public,max-age=31536000,immutable"
     Header unset ETag
   </FilesMatch>