| server { |
| listen 80; |
| server_name localhost; |
| |
| |
| root /usr/share/nginx/html; |
| index index.html; |
| |
| |
| charset utf-8; |
| |
| |
| location / { |
| try_files $uri $uri/ /index.html; |
| } |
| |
| |
| location ~* \.(css|js|png|jpg|jpeg|gif|ico|svg|mp3|wav|ogg)$ { |
| expires 1y; |
| add_header Cache-Control "public, immutable"; |
| add_header Access-Control-Allow-Origin "*"; |
| } |
| |
| |
| location ~* \.html$ { |
| expires 1h; |
| add_header Cache-Control "public"; |
| } |
| |
| |
| gzip on; |
| gzip_vary on; |
| gzip_min_length 1024; |
| gzip_proxied any; |
| gzip_comp_level 6; |
| gzip_types |
| application/atom+xml |
| application/geo+json |
| application/javascript |
| application/x-javascript |
| application/json |
| application/ld+json |
| application/manifest+json |
| application/rdf+xml |
| application/rss+xml |
| application/xhtml+xml |
| application/xml |
| font/eot |
| font/otf |
| font/ttf |
| image/svg+xml |
| text/css |
| text/javascript |
| text/plain |
| text/xml; |
| |
| |
| add_header X-Frame-Options "SAMEORIGIN" always; |
| add_header X-Content-Type-Options "nosniff" always; |
| add_header X-XSS-Protection "1; mode=block" always; |
| add_header Referrer-Policy "no-referrer-when-downgrade" always; |
| |
| |
| error_page 404 /index.html; |
| |
| |
| access_log /var/log/nginx/access.log; |
| error_log /var/log/nginx/error.log; |
| } |
|
|