mirror of https://github.com/flarum/flarum
revert formatting changes
parent
5f38b350f7
commit
f6d34376cd
11
.nginx.conf
11
.nginx.conf
|
@ -25,15 +25,19 @@ location ~ \.php$ {
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_pass php;
|
fastcgi_pass php;
|
||||||
}
|
}
|
||||||
|
|
||||||
# The following directives are based on best practices from H5BP Nginx Server Configs
|
# The following directives are based on best practices from H5BP Nginx Server Configs
|
||||||
# https://github.com/h5bp/server-configs-nginx
|
# https://github.com/h5bp/server-configs-nginx
|
||||||
|
|
||||||
# Expire rules for static content
|
# Expire rules for static content
|
||||||
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
|
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
|
||||||
add_header Cache-Control "max-age=0";
|
add_header Cache-Control "max-age=0";
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~* \.(?:rss|atom)$ {
|
location ~* \.(?:rss|atom)$ {
|
||||||
add_header Cache-Control "max-age=3600";
|
add_header Cache-Control "max-age=3600";
|
||||||
}
|
}
|
||||||
|
|
||||||
# allow browser cache for all static assets
|
# allow browser cache for all static assets
|
||||||
location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|ttf|m4a|mp4|ttf|jpe?g|gif|cur|heic|png|tiff|ico|zip|webm|mp3|aac|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf|webp)$ {
|
location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|ttf|m4a|mp4|ttf|jpe?g|gif|cur|heic|png|tiff|ico|zip|webm|mp3|aac|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf|webp)$ {
|
||||||
# enable CORS
|
# enable CORS
|
||||||
|
@ -43,13 +47,17 @@ location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|ttf|m4a|mp4|ttf|jpe?g|gif|cur
|
||||||
log_not_found off;
|
log_not_found off;
|
||||||
expires max;
|
expires max;
|
||||||
}
|
}
|
||||||
|
|
||||||
# allow browser cache for 30d on css & js files
|
# allow browser cache for 30d on css & js files
|
||||||
location ~* \.(?:css(\.map)?|js(\.map)?)$ {
|
location ~* \.(?:css(\.map)?|js(\.map)?)$ {
|
||||||
|
# enable CORS
|
||||||
add_header "Access-Control-Allow-Origin" "*";
|
add_header "Access-Control-Allow-Origin" "*";
|
||||||
|
# do not log 404 errors for static files
|
||||||
access_log off;
|
access_log off;
|
||||||
log_not_found off;
|
log_not_found off;
|
||||||
expires 30d;
|
expires 30d;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Security settings for better privacy
|
# Security settings for better privacy
|
||||||
# Deny hidden files & directory, excepted .well-known
|
# Deny hidden files & directory, excepted .well-known
|
||||||
location ~ /\.(?!well-known\/) {
|
location ~ /\.(?!well-known\/) {
|
||||||
|
@ -67,7 +75,8 @@ gzip_comp_level 5;
|
||||||
gzip_min_length 256;
|
gzip_min_length 256;
|
||||||
gzip_proxied any;
|
gzip_proxied any;
|
||||||
gzip_vary on;
|
gzip_vary on;
|
||||||
gzip_types application/atom+xml
|
gzip_types
|
||||||
|
application/atom+xml
|
||||||
application/javascript
|
application/javascript
|
||||||
application/json
|
application/json
|
||||||
application/ld+json
|
application/ld+json
|
||||||
|
|
Loading…
Reference in New Issue