LoginSignup
0
1

More than 3 years have passed since last update.

weavescopeをApache2.4でproxyする方法

Last updated at Posted at 2019-12-19

概要

weavescopeはDockerの相関図をリアルタイムに表示してくれるとてもかっこよいソフトだ。
https://github.com/weaveworks/scope

しかし、ポート番号でアクセスするのがかっこ悪いのでproxyを噛まそうとするとよくはまるらしい。
https://github.com/weaveworks/scope/issues/3725

かくいう私もその口。

結論

WebSocketも転送してやらないとならない

Apacheの設定ファイル例のコピペ

via https://github.com/weaveworks/scope/issues/3725#issuecomment-567626454

<VirtualHost *:443>
    ServerName weavescope.<your domain>.jp


    SSLEngine on
    ServerAdmin webmaster@localhost
    SSLCertificateFile /etc/letsencrypt/live/<your domain>/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/<your domain>/privkey.pem
    SSLCertificateChainFile /etc/letsencrypt/live/<your domain>/chain.pem


    ProxyRequests Off
    ProxyPreserveHost On

    RewriteEngine On
    RewriteCond %{HTTP:Connection} Upgrade [NC]
    RewriteCond %{HTTP:Upgrade} websocket [NC]
    RewriteRule /(.*) ws://localhost:4040/$1 [P,L]

    RequestHeader set X-Forwarded-Proto "https"
    RequestHeader set X-Forwarded-Port "443"


    ProxyPass / http://localhost:4040/
    ProxyPassReverse / http://localhost:4040/
    ProxyPass / ws://localhost:4040/
    ProxyPassReverse / ws://localhost:4040/

</VirtualHost>
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1