mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-08-10 23:11:02 +08:00
major refactor
This commit is contained in:
52
public/templates/conf/_general.conf.html
Normal file
52
public/templates/conf/_general.conf.html
Normal file
@@ -0,0 +1,52 @@
|
||||
# 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 ~ /\. {
|
||||
deny all;
|
||||
}<span ng-if="data.expires_assets && data.expires_assets !== data.expires_media">
|
||||
|
||||
# assets
|
||||
location ~* \.(?:{{ extensions.assets }})$ {
|
||||
expires {{ data.expires_assets }};<!--
|
||||
|
||||
✘ accessLog --><span ng-if="isAccessLog()">
|
||||
access_log off;</span>
|
||||
}</span><span ng-if="data.expires_media">
|
||||
|
||||
# {{ data.expires_assets && data.expires_assets === data.expires_media ? 'assets, ' : '' }}media
|
||||
location ~* \.(?:{{ data.expires_assets && data.expires_assets === data.expires_media ? extensions.assets + '|' : '' }}{{ extensions.images }}|{{ extensions.audio }}|{{ extensions.video }})$ {
|
||||
expires {{ data.expires_media }};<!--
|
||||
|
||||
✘ accessLog --><span ng-if="isAccessLog()">
|
||||
access_log off;</span>
|
||||
}</span><span ng-if="data.expires_svg && data.expires_svg !== data.expires_fonts">
|
||||
|
||||
# svg
|
||||
location ~* \.{{ extensions.svg }}$ {
|
||||
add_header Access-Control-Allow-Origin "*";
|
||||
expires {{ data.expires_svg }};<!--
|
||||
|
||||
✘ accessLog --><span ng-if="isAccessLog()">
|
||||
access_log off;</span>
|
||||
}</span><span ng-if="data.expires_fonts">
|
||||
|
||||
# {{ data.expires_svg && data.expires_svg === data.expires_fonts ? 'svg, ' : '' }}fonts
|
||||
location ~* \.(?:{{ data.expires_svg && data.expires_svg === data.expires_fonts ? extensions.svg + '|' : '' }}{{ extensions.fonts }})$ {
|
||||
add_header Access-Control-Allow-Origin "*";
|
||||
expires {{ data.expires_fonts }};<!--
|
||||
|
||||
✘ accessLog --><span ng-if="isAccessLog()">
|
||||
access_log off;</span>
|
||||
}</span>
|
||||
<span ng-if="isGzip()">
|
||||
# gzip
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
gzip_comp_level 6;
|
||||
gzip_types {{ gzipTypes }};</span>
|
Reference in New Issue
Block a user