45 lines
1.4 KiB
Plaintext
45 lines
1.4 KiB
Plaintext
server {
|
|
if ($host = pwd.xiongxiao.me) {
|
|
return 301 https://$host$request_uri;
|
|
} # managed by Certbot
|
|
|
|
|
|
listen 80;
|
|
#填写绑定证书的域名
|
|
server_name pwd.xiongxiao.me;
|
|
#把http的域名请求转成https
|
|
rewrite ^(.*)$ https://${server_name}$1 permanent;
|
|
# return 301 https://$host$request_uri;
|
|
|
|
|
|
}
|
|
server {
|
|
listen 443 ssl;
|
|
#填写绑定证书的域名
|
|
server_name pwd.xiongxiao.me;
|
|
#网站主页路径。此路径仅供参考,具体请您按照实际目录操作。
|
|
# root /root/web;
|
|
index index.html index.htm;
|
|
#证书文件名称
|
|
#ssl_certificate /etc/nginx/conf/short.xiongxiao.me_bundle.crt;
|
|
#私钥文件名称
|
|
#ssl_certificate_key /etc/nginx/conf/short.xiongxiao.me.key;
|
|
ssl_session_timeout 5m;
|
|
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
|
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
location / {
|
|
# root /root/web;
|
|
proxy_set_header HOST $host;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_pass http://127.0.0.1:8180/;
|
|
}
|
|
|
|
ssl_certificate /etc/letsencrypt/live/pwd.xiongxiao.me/fullchain.pem; # managed by Certbot
|
|
ssl_certificate_key /etc/letsencrypt/live/pwd.xiongxiao.me/privkey.pem; # managed by Certbot
|
|
}
|
|
|