1

I have a problem. Apache listens on a white ip and proxies all requests /ssd on nginx that proxies requests /city-dashboard to another server with websockets. In apache config:

ProxyPass /ssd/ http://10.127.32.24
ProxyPassReverse /ssd/ http://10.127.32.24

nginx config: on nginx.conf:

 map $http_upgrade $connection_upgrade {
   default upgrade;
   ''      close;

} include /etc/nginx/conf.d/*.conf; on default.conf

 location /city-dashboard/stream {
     proxy_pass http://10.127.32.24:5000/stream;
     proxy_set_header Host $host;
     proxy_http_version 1.1;
     proxy_set_header Upgrade $http_upgrade;
     proxy_set_header Connection $connection_upgrade;
 }

Request headers:

GET ws://x.x.x.x/ssd/city-dashboard/stream HTTP/1.1 
Host: x.x.x.x 
Connection: Upgrade 
Pragma: no-cache 
Cache-Control: no-cache 
Upgrade: websocket 
Origin: http://x.x.x.x 
Sec-WebSocket-Version: 13 
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36 
Accept-Encoding: gzip, deflate, sdch 
Accept-Language: en-US,en;q=0.8 
Sec-WebSocket-Key: 881o9c/z3Q437JFCti3BIw== 
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

Response headers:

Connection:Upgrade, close
Content-Length:34
Content-Type:text/html; charset=UTF-8
Date:Wed, 19 Aug 2015 16:53:40 GMT
Server:nginx/1.8.0
Upgrade:websocket

Connection: close

Status Code 400 Bad Request what am I doing wrong? I think maybe apache or nginx cut the headers, how to make that they did not?

I tried write so at apache conf:

Header set Connection "Upgrade"
RequestHeader setifempty Connection "Upgrade"
Header set Upgrade "websocket"
RequestHeader setifempty Upgrade "websocket"
reddaemon
  • 11
  • 3

0 Answers0