内容纲要
概要描述
sophon 2.X版本的内外网访问,修改步骤。
详细说明
- 找到并修改安装实例sophonX的配置文件,目录为 /etc/sophonX/conf/ui/default
- 修改以下几项X-Forwarded-Proto、X-Forwarded-For、X-Forwarded-Port,其意义分别为协议、IP(或域名)、端口,修改为浏览器上访问Sophon的协议、IP(或域名)、端口值
location /gateway/ { proxy_pass http://tw-node3228:8700/; proxy_http_version 1.1; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-For 172.16.3.128; proxy_set_header X-Forwarded-Port 8066; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host:$server_port; proxy_cache_bypass $http_upgrade; proxy_read_timeout 36000s; } location ~ ^/(cas|api){ proxy_pass http://tw-node3228:8700; proxy_http_version 1.1; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-For 172.16.3.128; proxy_set_header X-Forwarded-Port 8066; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host:$server_port; proxy_cache_bypass $http_upgrade; } location /nb-proxy/ { proxy_pass http://tw-node41:8709/nb-proxy/; proxy_http_version 1.1; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-For 172.16.3.128; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host:$server_port; proxy_cache_bypass $http_upgrade; }
- 若CAS也配置了内外网,则需在配置文件 /etc/sophonX/conf/user/user.conf 修改(或添加)配置项 cas.service.web.prefix=https://180.167.8.36:8393/cas(值为浏览器访问cas的地址)
- 重启整个sophon服务