chore: update 1 file(s)
This commit is contained in:
31
nginx.conf
31
nginx.conf
@@ -1,13 +1,13 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name localhost;
|
server_name _;
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
# Disable caching for all responses
|
# Disable caching for all responses during debugging
|
||||||
add_header Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0";
|
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
|
||||||
add_header Pragma "no-cache";
|
add_header Pragma "no-cache" always;
|
||||||
expires off;
|
add_header Expires "0" always;
|
||||||
|
|
||||||
# Favicon
|
# Favicon
|
||||||
location = /favicon.ico {
|
location = /favicon.ico {
|
||||||
@@ -16,14 +16,14 @@ server {
|
|||||||
log_not_found off;
|
log_not_found off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = style2.css {
|
# Serve shared JS and CSS directories at root
|
||||||
try_files /style2.css =204;
|
location /js/ {
|
||||||
|
try_files $uri =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = chatv3.js {
|
location /css/ {
|
||||||
try_files /chatv3.js =204;
|
try_files $uri =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Custom 404 page
|
# Custom 404 page
|
||||||
error_page 404 /404.html;
|
error_page 404 /404.html;
|
||||||
location = /404.html {
|
location = /404.html {
|
||||||
@@ -77,9 +77,20 @@ server {
|
|||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
|
# Cache static assets with content hash - minimal caching
|
||||||
|
location ~* \.(js|css)$ {
|
||||||
|
expires 1s; # 1 second for rapid iteration
|
||||||
|
add_header Cache-Control "public, max-age=1, must-revalidate" always;
|
||||||
|
}
|
||||||
|
# Cache images and icons - short caching
|
||||||
|
location ~* \.(ico|png|svg|jpg|jpeg|gif|webp)$ {
|
||||||
|
expires 5s; # 5 seconds, adjust as needed
|
||||||
|
add_header Cache-Control "public, max-age=5, must-revalidate" always;
|
||||||
|
}
|
||||||
|
|
||||||
# Gzip compression for better performance
|
# Gzip compression for better performance
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_vary on;
|
gzip_vary on;
|
||||||
|
gzip_min_length 1024;
|
||||||
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json;
|
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user