I set same configuration except proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; and between the nginx proxy mechine and server ,there is a virtual machine(192.9.9.5) for security and mapping relationship between port. Structure is similar like:
servers(running spark+zeppelin): 192.20.20.9:3008 (zeppelin web) 192.20.20.9:3009 (websocket) mapping to : virtual machine(proxy_pass):192.9.9.5:3008(zeppelin web) 192.9.9.5:3009(websocket) nginx set reverse proxy (IP : 172.101.103.102) local mechine (access nginx to visit zeppelin) : 172.101.103.102:3008 (zeppelin web) 172.101.103.102:3009 (websocket) nginx reverse proxy set : #zeppelin web. server { listen 30008; server_name 172.101.103.102; location / { proxy_pass http://192.9.9.5:3008/; } } map $http_upgrade $connection_upgrade { default upgrade; '' close; } upstream websocket { server 192.9.9.5:3009; } #zeppelin websockt. server { listen 30009; server_name 172.101.103.102; location / { proxy_pass http://websocket; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } } the problem is access to 192.9.9.5:3008 is always connected ,but access to 172.101.103.102:3008 is disconnected every few seconds Appreciate any help. thx all. moonssang 原始邮件 发件人: Jitender Aswani<jiten...@sparklinedata.com> 收件人: users<users@zeppelin.incubator.apache.org> 发送时间: 2015年9月5日(周六) 03:10 主题: Re: Zeppelin not accessible behind a proxy server I am sharing my nginx configuration. I use nginx for proxy and load-balancing with two servers running spark+zeppelin. This setup works fine. All request go to the nginx URL which gets passed to zeppelin machines. upstream backend { server ec2-52-xx-xxx-xxx.compute-1.amazonaws.com; server ec2-52-xx-xxx-xx.compute-1.amazonaws.com; } upstream backendWS { server ec2-52-xx-xxx-xx.compute-1.amazonaws.com:8002; server ec2-52-xx-xxx-xx.compute-1.amazonaws.com:8002; } server { listen 80; listen [::]:80; server_name YOUR_SERVER_NAME; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_pass http://backend; } } server { listen 8002; listen [::]:8002; server_name SAME_SERVER_NAME location / { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; proxy_pass http://backendWS; } } Best, Jitender Founder, SparklineData Leave ETL and Cubes Behind and Jump Straight to Lightning Fast Analytics to Power Outbound Marketing On Wed, Sep 2, 2015 at 5:59 AM, 박성열 <sypa...@gmail.com> wrote: 2015. 9. 2. 오후 4:11에 "yupeng" <yup...@qfpay.com>님이 작성: Hi, I meet the same problem,While I can access the Zeppelin URL by the proxy it shows in disconnected status every seconds.and i curl to my websocket port and get empty result. [ssang@mmdev01 conf]$ curl -v 192.9.9.5:30009 * About to connect() to 192.9.9.5 port 30009 (#0) * Trying 192.9.9.5... connected * Connected to 192.9.9.5 (192.9.9.5) port 30009 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.16.2.3 > Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: 192.9.9.5:30009 > Accept: */* > * Empty reply from server * Connection #0 to host 192.9.9.5 left intact curl: (52) Empty reply from server * Closing connection #0 the zeppelin version is branch-0.5 from github. it run normal period of time when link into server directly until we change the way link to server (use nginx as a websocket reverse proxy). Appreciate any help. Thanks, Moonssang ------------------------------------------------- From moon soo Lee <m...@apache.org> Subject Re: Zeppelin not accessible behind a proxy server Date Thu, 25 Jun 2015 20:31:22 GMT >Hi, >Could you verify websocket port access using some tool like curl? >Zeppelin uses two ports. one for rest api and one for websocket (usually >rest api port + 1) >For example, i can curl to my websocket port and get empty result. Lees-MacBook:zeppelin moon$ curl -v localhost:8081 * Rebuilt URL to: localhost:8081/ * Hostname was NOT found in DNS cache * Trying ::1... * Connected to localhost (::1) port 8081 (#0) > GET / HTTP/1.1 > User-Agent: curl/7.37.1 > Host: localhost:8081 > Accept: */* > * Empty reply from server * Connection #0 to host localhost left intact curl: (52) Empty reply from server Thanks, moon On Sat, Jun 20, 2015 at 5:09 AM Rishitesh Mishra <rishi80.mis...@gmail.com> wrote: > Hi All, > I am setting up a spark cluster on a bunch of machines which is accessible > only via a proxy from my network. > Also I have started a Zeppelin server on the remote network, While I can > access the Zeppelin URL by the proxy it always shows in disconnected > status. > Looking at the Zeppelin docs it looks like Zeppelin maintains a Websocket > connection from browser to server. > I also tested our proxy which allows Websocket connections on 443 . Still > I am not able to see connected status even after starting the Zeppelin > Websocket on 443. > > Appreciate any help. > > Thanks, > Rishi >