50 lines
1.1 KiB
Nginx Configuration File
50 lines
1.1 KiB
Nginx Configuration File
server {
|
|||
|
|
listen 80;
|
||
|
|
server_name _;
|
||
|
|
|
||
|
|
root /usr/share/nginx/html;
|
||
|
|
index index.html;
|
||
|
|
|
||
|
|
gzip on;
|
||
|
|
gzip_disable "msie6";
|
||
|
|
gzip_vary on;
|
||
|
|
gzip_proxied any;
|
||
|
|
gzip_comp_level 6;
|
||
|
|
gzip_buffers 16 8k;
|
||
|
|
gzip_http_version 1.1;
|
||
|
|
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
||
|
|
|
||
|
|
location / {
|
||
|
|
try_files $uri $uri/ /index.html;
|
||
|
|
}
|
||
|
|
|
||
|
|
location /assets/ {
|
||
|
|
expires 1y;
|
||
|
|
add_header Cache-Control "public, no-transform";
|
||
|
|
access_log off;
|
||
|
|
}
|
||
|
|
|
||
|
|
location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
|
||
|
|
add_header Access-Control-Allow-Origin "*";
|
||
|
|
expires 1M;
|
||
|
|
access_log off;
|
||
|
|
add_header Cache-Control "public";
|
||
|
|
}
|
||
|
|
|
||
|
|
server_tokens off;
|
||
|
|
|
||
|
|
error_log /var/log/nginx/error.log warn;
|
||
|
|
access_log /var/log/nginx/access.log;
|
||
|
|
|
||
|
|
location ~ /\. {
|
||
|
|
deny all;
|
||
|
|
access_log off;
|
||
|
|
log_not_found off;
|
||
|
|
}
|
||
|
|
|
||
|
|
error_page 500 502 503 504 /50x.html;
|
||
|
|
location = /50x.html {
|
||
|
|
root /usr/share/nginx/html;
|
||
|
|
}
|
||
|
|
}
|