搭建coderserver 用于golang的开发环境
内网直接 http://10.0.0.100:8080 访问,外网套ssl
套ssl是由路由器上运行的 Nginx Proxy Manager
(NPM)统一管理, 基于nginx
nmp上创建站点配置ssl后,直接访问会提示 WebSocket close with status code 1006
edit这个站点,点击 Advanced 输入
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| location /
{
proxy_pass http://10.0.0.100:8080;
proxy_http_version 1.1;
proxy_redirect off;
proxy_set_header Host https://code.leiyanhui.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_connect_timeout 60;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
add_header Cache-Control no-cache;
}
|
完毕
宝塔 或者 其他nginx环境一样配置