File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ### Nginx反向代理WebSocket ###
2+
3+ worker_processes 1;
4+ events {
5+ worker_connections 1024;
6+ }
7+
8+ http {
9+ include mime.types;
10+ default_type application/octet-stream;
11+ sendfile on;
12+ autoindex on;
13+
14+ #keepalive_timeout 0;
15+ keepalive_timeout 65;
16+
17+ map $http_upgrade $connection_upgrade {
18+ default upgrade;
19+ '' close;
20+ }
21+
22+ server {
23+ listen 80;
24+ server_name example.com;
25+
26+ #charset koi8-r;
27+
28+ #access_log logs/host.access.log main;
29+
30+ location / {
31+ proxy_pass http://120.27.114.229/;
32+ proxy_redirect off;
33+
34+ proxy_set_header X-Real-IP $remote_addr;
35+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
36+ proxy_set_header Host $http_host;
37+ proxy_set_header X-NginX-Proxy true;
38+
39+ proxy_http_version 1.1;
40+ proxy_set_header Upgrade $http_upgrade;
41+ proxy_set_header Connection "upgrade";
42+ }
43+ }
44+ }
45+
You can’t perform that action at this time.
0 commit comments