安装Halo2
docker run -it -d --name halo2 -p 8090:8090 -v /projects/halo2:/root/.halo2 --memory 512m -e JVM_OPTS="-Xmx256m -Xms256m" registry.fit2cloud.com/halo/halo:2.20
配置Nginx
自签名证书
cd /etc/nginx
mkdir certs
openssl req -newkey rsa:2048 -nodes -keyout certs/server.key -x509 -days 36500 -out certs/server.crt
配置转发
vim /etc/nginx/conf.d/default.conf
server {
listen 8090 ssl;
# 证书绑定的域名
server_name 121.196.226.248;
# 证书文件的位置
ssl_certificate certs/server.crt;
# 私钥文件的位置
ssl_certificate_key certs/server.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;
access_log /var/log/nginx/halo2_access.log main;
error_log /var/log/nginx/halo2_error.log;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location / {
proxy_connect_timeout 86400s;
proxy_send_timeout 86400s;
proxy_read_timeout 86400s;
proxy_pass http://127.0.0.1:8091/;
}
}
nginx -s reload
评论区