Created
December 12, 2016 04:04
-
-
Save XiangpengHao/a327001a7507dbe3bf6c45e30c264885 to your computer and use it in GitHub Desktop.
A simple Nginx config template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server{ | |
listen 80; | |
server_name file.zjuqsc.com; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 12081; | |
listen 443 ssl http2; | |
server_name file.zjuqsc.com; | |
ssl_certificate /srv/ssl/file.zjuqsc.com.crt; | |
ssl_certificate_key /srv/ssl/file.zjuqsc.com.key; | |
access_log /var/log/nginx/file_access.log; | |
error_log /var/log/nginx/file_error.log; | |
root /srv/stor1_4tb/file/sftp; | |
charset utf-8; | |
autoindex on; | |
autoindex_exact_size off; | |
autoindex_localtime on; | |
error_page 403 = /errpage/403.html; | |
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; | |
location ~ .bat$ { | |
allow 10.76.8.0/24; | |
allow 10.79.25.65; | |
allow 10.79.25.67; | |
allow 10.79.25.68; | |
allow 192.168.0.0/16; | |
allow 10.79.24.62; | |
allow 172.16.0.0/12; | |
allow 10.202.68.0/24; | |
allow 10.110.33.213; | |
deny all; | |
} | |
location /!【求是潮】☆.☆欢迎回家/ { | |
rewrite . https://bbs.zjuqsc.com?from=$host redirect; | |
} | |
location /errpage/ { | |
alias /srv/stor1_4tb/file/errpage/; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment