Skip to content

Commit

Permalink
Update nginx.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
lxhao61 committed Aug 25, 2021
1 parent 19f1a82 commit 1fd580d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions v2ray(SS+v2ray-plugin)+caddy\nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ http {
listen 443 ssl; #IPv4,https默认监听端口。
listen [::]:443 ssl; #IPv6,https默认监听端口。无IPv6,此项可以删除。
server_name xx.yy; #更改为自己的域名
if ($host ~ "\d+\.\d+\.\d+\.\d") { #禁止以ip方式访问网站
return 404;
}

ssl_certificate /home/tls/xx.yy/xx.yy.crt; #换成自己的证书,绝对路径。
ssl_certificate_key /home/tls/xx.yy/xx.yy.key; #换成自己的密钥,绝对路径。
Expand All @@ -36,6 +33,9 @@ http {

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always; #启用HSTS
location / {
if ($host ~* "\d+\.\d+\.\d+\.\d+") { #禁止以ip方式访问网站
return 400;
}
root /var/www/html/; #修改成自己存放的web文件路径
index index.html index.htm;
}
Expand Down

0 comments on commit 1fd580d

Please sign in to comment.