准备工作
官方文档:使用docker-compose部署halo
xizeyoupan/Meting-API: 🐳 Meting API 的容器化与部署 (github.com)
自建Meting也可参考自建Meting-API并启用https
Nginx配置
server {
listen 443 ssl;
server_name blog.colorfulstage.cn;
ssl_certificate ...;
ssl_certificate_key ...;
location / {
client_max_body_size 1536m;
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://localhost:8090;
}
location /meting/ {
valid_referers *.colorfulstage.cn colorfulstage.cn;
if ($invalid_referer) {
return 403;
}
proxy_set_header X-Forwarded-Url $scheme://$host:$server_port/meting;
proxy_pass http://localhost:3000/;
}
}
server {
listen 443 ssl;
server_name colorfulstage.cn;
ssl_certificate ...;
ssl_certificate_key ...;
rewrite ^(.*)$ https://blog.colorfulstage.cn$1 permanent;
}