use ssl in nginx

This commit is contained in:
liaojack8 2020-07-05 01:33:25 +08:00
parent 97e7352f57
commit 5f424722f7
1 changed files with 13 additions and 4 deletions

View File

@ -131,9 +131,18 @@ echo -e "\033[1;32m“nginx”起一个web服务......\033[0m"
cd $nginx_conf
echo "server {
listen 80;
server_name $YOUR_DOMAIN_NAME;
location / {
listen 80;
server_name ecbot.nctu.me;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
ssl on;
ssl_certificate /etc/ssl/certificate-all.crt;
ssl_certificate_key /etc/ssl/private.key;
server_name $YOUR_DOMAIN_NAME;
location / {
proxy_pass http://127.0.0.1:23333/;
}
}" >${nginx_conf}gdutilsbot.conf &&