部署方式 | How to Deploy
使用一键部署脚本 | Using zealot-docker on-click install (Default)
部署版本 | Version
nightly (Default)
反代服务 | Reverse Proxy
nginx
HTTPS 证书类型 | HTTPS(SSL)
无 none
已阅读文档 | Read the document
描述 | Description
我这台服务器是从另一台服务器上代理过来的,所有流量走 80 端口。
然后我把 docker 映射到服务器的 9527 端口,服务器的 nginx 把 80 端口的流量都转发到 9527,然后发现出来的网页一直有几个问题。
看控制台,首先是有个 /cable 一直连不上,显示 WebSocket connection to 'wss://xxx/cable' failed: There was a bad response from the server.
其次是点第三方登录显示跨域问题:Origin https://xxx is not allowed by Access-Control-Allow-Origin. Status code: 200
最后是注册按钮点击无反应,错误如下:
Error: Form responses must redirect to another location
requestSucceededWithResponse — application-a6c0272bfdcd3fded69270e0048f85ece58e49fd.js:14198
(匿名函数) — application-a6c0272bfdcd3fded69270e0048f85ece58e49fd.js:13969
asyncFunctionResume
(匿名函数) — application-a6c0272bfdcd3fded69270e0048f85ece58e49fd.js:13947
asyncFunctionResume
(匿名函数)
promiseReactionJobWithoutPromise
promiseReactionJob
不知道是不是之前没有过和我类似的情况。请大佬指点怎么解决?
问题日志 | Relevant log output
我的 nginx 配置如下:
server {
listen 80;
server_name xxx;
# location ~* ^(/assets|/favicon.ico) {
# access_log off;
# expires max;
# }
# 上一段取消注释,可以解决跨域问题,但会导致 css/js 等资源文件取不到
location / {
try_files $uri @zealot;
}
location @zealot {
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;
proxy_set_header Proxy "";
proxy_pass_header Server;
proxy_pass http://0.0.0.0:9527; # 根据实际情况修改地址和端口号
proxy_buffering on;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
}
location /cable {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://0.0.0.0:9527; # 根据实际情况修改地址和端口号
}
}
部署方式 | How to Deploy
使用一键部署脚本 | Using zealot-docker on-click install (Default)
部署版本 | Version
nightly (Default)
反代服务 | Reverse Proxy
nginx
HTTPS 证书类型 | HTTPS(SSL)
无 none
已阅读文档 | Read the document
描述 | Description
我这台服务器是从另一台服务器上代理过来的,所有流量走 80 端口。
然后我把 docker 映射到服务器的 9527 端口,服务器的 nginx 把 80 端口的流量都转发到 9527,然后发现出来的网页一直有几个问题。
看控制台,首先是有个 /cable 一直连不上,显示 WebSocket connection to 'wss://xxx/cable' failed: There was a bad response from the server.
其次是点第三方登录显示跨域问题:Origin https://xxx is not allowed by Access-Control-Allow-Origin. Status code: 200
最后是注册按钮点击无反应,错误如下:
不知道是不是之前没有过和我类似的情况。请大佬指点怎么解决?
问题日志 | Relevant log output
我的 nginx 配置如下: server { listen 80; server_name xxx; # location ~* ^(/assets|/favicon.ico) { # access_log off; # expires max; # } # 上一段取消注释,可以解决跨域问题,但会导致 css/js 等资源文件取不到 location / { try_files $uri @zealot; } location @zealot { 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; proxy_set_header Proxy ""; proxy_pass_header Server; proxy_pass http://0.0.0.0:9527; # 根据实际情况修改地址和端口号 proxy_buffering on; proxy_redirect off; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; } location /cable { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_pass http://0.0.0.0:9527; # 根据实际情况修改地址和端口号 } }