44 lines
1.8 KiB
HTML
44 lines
1.8 KiB
HTML
# headers
|
|
add_header X-Frame-Options "SAMEORIGIN" always;
|
|
add_header X-XSS-Protection "1; mode=block" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header X-UA-Compatible "IE=Edge" always;
|
|
add_header Cache-Control "no-transform" always;
|
|
|
|
# . files
|
|
location ~ /\.(?!well-known).* {
|
|
deny all;
|
|
}<span ng-if="data.expires.css_js !== '' && data.expires.css_js !== data.expires.media">
|
|
|
|
# css/js
|
|
location ~* \.(css|js)$ {
|
|
expires {{ data.expires.css_js }};<span ng-if="data.access_log !== ''">
|
|
access_log off;</span>
|
|
}</span><span ng-if="data.expires.media !== ''">
|
|
|
|
# {{ data.expires.css_js !== '' && data.expires.css_js === data.expires.media ? 'css/js, ' : '' }}media
|
|
location ~* \.({{ data.expires.css_js !== '' && data.expires.css_js === data.expires.media ? 'css|js|' : '' }}jpe?g|gif|png|heic|ico|cur|mp4|mov|ogg|ogv|webm|htc)$ {
|
|
expires {{ data.expires.media }};<span ng-if="data.access_log !== ''">
|
|
access_log off;</span>
|
|
}</span><span ng-if="data.expires.svg !== '' && data.expires.svg !== data.expires.font">
|
|
|
|
# svg
|
|
location ~* \.svg$ {
|
|
add_header Access-Control-Allow-Origin "*";
|
|
expires {{ data.expires.svg }};<span ng-if="data.access_log !== ''">
|
|
access_log off;</span>
|
|
}</span><span ng-if="data.expires.font !== ''">
|
|
|
|
# {{ data.expires.svg !== '' && data.expires.svg === data.expires.font ? 'svg, ' : '' }}fonts
|
|
location ~* \.({{ data.expires.svg !== '' && data.expires.svg === data.expires.font ? 'svg|' : '' }}ttf|ttc|otf|eot|woff|woff2)$ {
|
|
add_header Access-Control-Allow-Origin "*";
|
|
expires {{ data.expires.font }};<span ng-if="data.access_log !== ''">
|
|
access_log off;</span>
|
|
}</span>
|
|
<span ng-if="data.gzip">
|
|
# gzip
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_proxied any;
|
|
gzip_comp_level 6;
|
|
gzip_types text/plain text/css text/xml application/json application/javascript application/xml+rss application/atom+xml image/svg+xml;</span> |