1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| server { listen 80; listen [::]:80; server_name your-domain.com; root /home/your-username/your-hexo-blog/public; index index.html index.htm; gzip on; gzip_types text/plain text/css application/json application/ javascript text/xml application/xml application/xml+rss text/javascript; gzip_proxied any; gzip_comp_level 6; gzip_buffers 16 8k; gzip_min_length 256; location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { expires 30d; add_header Cache-Control "public, no-transform"; } error_page 404 /404.html; location / { try_files $uri $uri/ =404; } server_tokens off; add_header X-Content-Type-Options nosniff; add_header X-Frame-Options SAMEORIGIN; add_header X-XSS-Protection "1; mode=block"; access_log /var/log/nginx/hexo-access.log; error_log /var/log/nginx/hexo-error.log; }
|