metersphere配置二级域名
proxy_pass http://IP地址:8081;# 代理到 MeterSphere。# WebSocket 支持(如果 MeterSphere 需要)# 可选:HTTPS 重定向。
1. 创建 Nginx 配置文件
在宿主机的 /opt/nginx-docker/conf/conf.d 目录下创建配置文件:
metersphere.conf
server {
listen 80;
server_name metersphere.ccokie.com;
location / {
proxy_pass http://IP地址:8081; # 代理到 MeterSphere
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket 支持(如果 MeterSphere 需要)
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# 可选:HTTPS 重定向
# listen 443 ssl;
# ssl_certificate /etc/nginx/ssl/metersphere.crt;
# ssl_certificate_key /etc/nginx/ssl/metersphere.key;
# if ($scheme = http) {
# return 301 https://$server_name$request_uri;
# }
}
重启 Nginx 服务
docker-compose down
docker-compose up -d
# 或热重载配置
docker exec my-nginx nginx -s reload
火山引擎开发者社区是火山引擎打造的AI技术生态平台,聚焦Agent与大模型开发,提供豆包系列模型(图像/视频/视觉)、智能分析与会话工具,并配套评测集、动手实验室及行业案例库。社区通过技术沙龙、挑战赛等活动促进开发者成长,新用户可领50万Tokens权益,助力构建智能应用。
更多推荐
所有评论(0)