12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- user nginx;
- worker_processes 1;
-
- error_log /var/log/nginx/error.log warn;
- pid /var/run/nginx.pid;
-
-
- events {
- worker_connections 1024;
- }
-
-
- http {
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
-
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"';
-
- access_log /var/log/nginx/access.log main;
-
- sendfile on;
-
- keepalive_timeout 65;
-
- server_tokens off;
-
- add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
- add_header Content-Security-Policy "default-src 'none'; script-src 'self'; img-src 'self'; style-src 'self'; font-src 'self'; frame-ancestors 'none'; form-action 'none'; base-uri 'none';";
- add_header X-Frame-Options "SAMEORIGIN";
- add_header X-Content-Type-Options "nosniff";
- add_header X-XSS-Protection "1; mode=block";
- add_header Expect-CT "enforce; max-age=3600";
- add_header Referrer-Policy "no-referrer";
-
- gzip on;
- gzip_vary on;
- gzip_proxied any;
- gzip_comp_level 6;
- gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
-
- map $http_accept $webp_suffix {
- "~*webp" ".webp";
- }
-
- server {
- listen 80;
- server_name localhost;
-
- location / {
- root /usr/share/nginx/html;
- index index.html index.htm;
-
- location /res {
- expires 1y;
- }
-
- location ~ \.(png|jpe?g)$ {
- try_files $uri$webp_suffix $uri =404;
- expires 1y;
- }
- }
-
- #error_page 404 /404.html;
-
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /usr/share/nginx/html;
- }
- }
-
- }
|