2016-09-15 4 views
1

웹 서버가 예약 프록시 역할을하는 Apache Webserver에서 Apache Zeppelin 인스턴스를 실행하고 있습니다.Apache 역 프록시의 Apache Zeppelin

리버스 프록시 사이트를 탐색하는 경우 https://my-domain.com/zeppelin/ 자산과 버튼이있는 웹 사이트가 있지만 모든 사이트가 연결되지만 Zeppelin의 websocket은 연결되지 않습니다. Browser-Dev-Tools는 https://my-domain.com/zeppelin/ws에 대해 405 HTTP method GET is not supported by this URL을 말합니다.

Zeppelin-Website (fx. http://priv.my-domain.com/zeppelin)에서 직접 작업 할 경우 모든 것이 잘 작동합니다. 따라서 Zeppelin-Code의 버그는 아니지만 reverse-proxy-config의 문제 인 것 같습니다. 내가 설정에서 첫 번째 WS-위치를 제거하면 그것은 차이가 없습니다

<VirtualHost *:443> 
    ServerName my-domain.com 
    # don't loose time with IP address lookups 
    HostnameLookups Off 
    ProxyRequests Off 
    ProxyPreserveHost Off 
    SSLEngine On 
    SSLProxyEngine On 
    SSLProxyVerify none 
    SSLProxyCheckPeerCN off 
    SSLProxyCheckPeerName off 
    ... 
    ssl cert stuff 
    ... 
    <Location /zeppelin/ws> 

     ProxyPass ws://priv.my-domain.com:8080/zeppelin/ws 
     ProxyPassReverse ws://priv.my-domain.com:8080/zeppelin/ws 

     Order deny,allow 
     Deny from all 

     Allow from <my-ip> 

    </Location> 

    <Location /zeppelin/> 

     ProxyPass http://priv.my-domain.com:8080/zeppelin/ 
     ProxyPassReverse http://priv.my-domain.com:8080/zeppelin/ 

     Order deny,allow 
     Deny from all 

     Allow from <my-ip> 

    </Location> 
    <Proxy *> 
     AddDefaultCharset Off 
     Order deny,allow 
     Allow from all 
    </Proxy> 
</VirtualHost> 

: 같은

내 아파치 리버스 프록시 설정 보인다. 좋은 생각이 있습니까?

해결 방법 : 아래 답변을 보내고 conf-file을 수정했으며 현재 작동 중입니다! 정말 고마워요!

내 작업의 conf : 이것은 사용자의 요구에 반드시 적용되지 일부 지정이 내가 사용하고있는 conf의입니다

<VirtualHost *:443> 
    ServerName my-domain.com 
    # don't loose time with IP address lookups 
    HostnameLookups Off 
    ProxyRequests Off 
    ProxyPreserveHost Off 
    SSLEngine On 
    SSLProxyEngine On 
    SSLProxyVerify none 
    SSLProxyCheckPeerCN off 
    SSLProxyCheckPeerName off 
    ... 
    ssl cert stuff 
    ... 
    <Location /zeppelin/> 

     ProxyPass http://priv.my-domain.com:8080/zeppelin/ 
     ProxyPassReverse http://priv.my-domain.com:8080/zeppelin/ 

     Order deny,allow 
     Deny from all 

     Allow from <my-ip> 

    </Location> 
    RewriteEngine On 
    RewriteCond %{HTTP:Upgrade} =WebSocket [NC,NV] 
    RewriteRule ^/(.*) ws://priv.my-domain.com:8080/$1 [P] 
    <Proxy *> 
     AddDefaultCharset Off 
     Order deny,allow 
     Allow from all 
    </Proxy> 
</VirtualHost> 

답변

2

:
- 하나의 인스턴스 당 - 메소 클러스터
앞에 서비스 발견 사용자와 자격 증명을 기반으로 라우팅 사용자는
여기

<VirtualHost *:3128> 
    <Location "/"> 
     AuthUserFile /.............../users 
     AuthName "xxxxxxxxxxxxx" 
     AuthGroupFile /dev/null 
     AuthType Basic 
     Require valid-user 
    </Location> 
    ServerName xxxxxxxxxxxxxxxxxxxxxxxxxxx 
    # SSLEngine on 
    # SSLCertificateFile "/.............../xxxxx.crt" 
    # SSLCertificateKeyFile "/.............../xxxxx.key" 

    #RewriteRules for datalab with user 
    RewriteCond %{HTTP:Upgrade} =WebSocket [NC,NV] 
    RewriteCond %{LA-U:REMOTE_USER} (aaaa) 
    RewriteRule ^/(.*) ws://azerty01:31321/$1 [P] 
    RewriteCond %{LA-U:REMOTE_USER} (aaaa) 
    RewriteRule ^/(.*) http://azerty01:31321/$1 [P,QSA,L] 
    ProxyPassReverse/http://azerty01:31321 

    #RewriteRules for datalab with user 
    RewriteCond %{HTTP:Upgrade} =WebSocket [NC,NV] 
    RewriteCond %{LA-U:REMOTE_USER} (bbbb) 
    RewriteRule ^/(.*) ws://azerty02:31901/$1 [P] 
    RewriteCond %{LA-U:REMOTE_USER} (bbbb) 
    RewriteRule ^/(.*) http://azerty02:31901/$1 [P,QSA,L] 
    ProxyPassReverse/http://azerty02:31901 

</VirtualHost> 
+0

감사합니다. 작동 중입니다. 사용자 인증없이 간략한 Rewrite-Part를 보려면 내 편집을 참조하십시오. – BeerCamper

1

인 내가 프록시 영 역 싶어 할 때 내가 만든 파일을 포함Zeppelin 서버. 원하는 경우 더 많이 또는 덜 잘라내어 vhosts conf 파일에 붙여 넣을 수 있습니다.

# 
# Apache Reverse Proxy settings for Zeppelin server. 
# note: 
# Change ZEPPELING_IP_OR_HOST and ZEPPELIN_PORT as appropriate. 
# 
# FreeBSD put into /usr/local/etc/apache24/Includes directory, 
# Linux may vary. 

# This is for your-host.your-domain.com/zeppelin 
# if you want zeppelin.your-host.your-domain.com 
# Put this into a vhosts file. 

RequestHeader set X_FORWARDED_PROTO 'https' 
ProxyPreserveHost On 
RequestHeader set X-Forwarded-Port "443" 
ProxyRequests  Off 
ProxyVia Off 
AllowEncodedSlashes NoDecode 


<Location /zeppelin/ws> 
    ProxyPass ws://ZEPPELIN_IP_OR_HOST:ZEPPELIN_PORT/zeppelin/ws 
    ProxyPassReverse ws://ZEPPELIN_IP_OR_HOST:ZEPPELIN_PORT/zeppenlin/ws 
</Location> 

ProxyPass  /zeppelin  http://ZEPPELIN_IP_OR_HOST:ZEPPELIN_PORT/zeppelin 
ProxyPassReverse /zeppelin  http://ZEPPELIN_IP_OR_HOST:ZEPPELIN_PORT/zeppelin 
0

그냥 여기에 추가하면 아래 설정으로 Apache2를 사용하여 제 플레인 인스턴스로 경로를 변경할 수있었습니다. 중요한 부분은 websocket 연결입니다.

당신이 개조에

sudo a2enmod proxy_wstunnel 

를 추가해야합니다.

sudo a2dissite 000-default 
sudo nano /etc/apache2/sites-available/proxy-host.conf 
    # Insert the following into the proxy-host.conf file 
    <VirtualHost *:80> 
     ServerName '<Zeppelin Public IP>:8080' 
     RewriteEngine On 
     RewriteCond %{HTTP:Upgrade} =websocket [NC] 
     RewriteRule /(.*)   ws://<Zeppelin Public IP>:8080/$1 [P,L] 
     RewriteCond %{HTTP:Upgrade} !=websocket [NC] 
    RewriteRule /(.*)   http://<Zeppelin Public IP>:8080/$1 [P,L] 
    ProxyPassReverse/http://<Zeppelin Public IP>:8080/ 
    </VirtualHost> 
    #/text insert 
sudo a2ensite proxy-host 
sudo nano /etc/apache2/ports.conf 
    #Add this to the ports.conf file and cntrl+X to save & exit 
    Listen 8080 
sudo /etc/init.d/apache2 restart 

그런 다음 당신은 HTTP에 갈 때 : 나는 다음 실행 // reverseproxypublicIP/그것은 당신의 제플린 인스턴스로 라우팅됩니다. 희망이 사람을 돕는다!

관련 문제