docs(nginx): improve nginx configuration
Remove etag off and improve Cache-Control Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
3a2c6afc0d
commit
6c992cade5
|
@ -66,6 +66,8 @@ server {
|
|||
|
||||
|
||||
location / {
|
||||
expires off;
|
||||
add_header Cache-Control "public, max-age=0, s-maxage=0, must-revalidate" always;
|
||||
proxy_pass http://localhost:4000;
|
||||
}
|
||||
|
||||
|
@ -75,24 +77,15 @@ server {
|
|||
default_type "text/plain";
|
||||
}
|
||||
|
||||
location ~ ^/img {
|
||||
location ~ ^/(assets|img) {
|
||||
root /opt/mobilizon/priv/static;
|
||||
etag off;
|
||||
access_log off;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
}
|
||||
|
||||
location ~ ^/(js|css) {
|
||||
root /opt/mobilizon/priv/static;
|
||||
etag off;
|
||||
access_log off;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable";
|
||||
}
|
||||
|
||||
location ~ ^/(media|proxy) {
|
||||
etag off;
|
||||
access_log off;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable";
|
||||
proxy_pass http://localhost:4000;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,6 +66,8 @@ server {
|
|||
|
||||
|
||||
location / {
|
||||
expires off;
|
||||
add_header Cache-Control "public, max-age=0, s-maxage=0, must-revalidate" always;
|
||||
proxy_pass http://localhost:4000;
|
||||
}
|
||||
|
||||
|
@ -75,24 +77,15 @@ server {
|
|||
default_type "text/plain";
|
||||
}
|
||||
|
||||
location ~ ^/img {
|
||||
location ~ ^/(assets|img) {
|
||||
root /opt/mobilizon/priv/static;
|
||||
etag off;
|
||||
access_log off;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
}
|
||||
|
||||
location ~ ^/(js|css) {
|
||||
root /home/mobilizon/live/priv/static;
|
||||
etag off;
|
||||
access_log off;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable";
|
||||
}
|
||||
|
||||
location ~ ^/(media|proxy) {
|
||||
etag off;
|
||||
access_log off;
|
||||
add_header Cache-Control "public, max-age=31536000, immutable";
|
||||
add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable";
|
||||
proxy_pass http://localhost:4000;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue