小智 7
尝试代理 tcp 流量而不是 http 流量
stream {
server {
listen SRC_IP:SRC_PORT;
proxy_pass DST_IP:DST_PORT;
}
}
Run Code Online (Sandbox Code Playgroud)
有关更多详细信息,请参阅 nginx 文档 https://docs.nginx.com/nginx/admin-guide/load-balancer/tcp-udp-load-balancer/
这是一个可能有效的配置。通过master进行代理并将所有内容转发到Server3。使用 ssl 端口但关闭 ssl。
\n\nserver {\n listen 443;\n server_name myserver.mydomain.whatever;\n\n ssl off;\n\n access_log /var/log/nginx/myserver.access.log;\n error_log /var/log/nginx/myserver.error.og;\n\n keepalive_timeout 60;\n\n location / {\n set $fixed_destination $http_destination;\n if ( $http_destination ~* ^https(.*)$ )\n {\n set $fixed_destination http$1;\n }\n\n proxy_set_header Host $host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n proxy_set_header Destination $fixed_destination;\n # Fix the \xe2\x80\x9cIt appears that your reverse proxy set up is broken" error.\n # might need to explicity set https://localip:port\n proxy_pass $fixed_destination;\n # force timeout if backend died.\n proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;\n proxy_read_timeout 90;\n proxy_redirect http:// https://;\n }\n}\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
11212 次 |
| 最近记录: |