0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ProxmoxのWebUIをApacheでリバプロしたい

Posted at

ProxmoxのWebUIをApacheでリバプロしたい

ホスト名関係とWebsocketでちょっと詰まった……
※hosts回り間違えるとWebUI死ぬので、コンソールへのSSH接続確認をしてから作業推奨

環境

以下環境で構築しています

Proxmox導入済み
ドメイン取得済み

Proxmox:
# pveversion
pve-manager/8.4.1/2a5fa54a8503f96d (running kernel: 6.8.12-9-pve)

リバプロ用Apache(別ホスト)
SSL証明書導入済

Proxmox側Hosts追記(最初からドメイン名で構築していれば不要)

Originヘッダーの整合性を取らないとWebsocketが通らない為ドメインを追記

XXX.XXX.XXX.XXX   prox hogehoge.com servername.local servername

Apachリバプロ

WebUIは通常通りProxyPassとReverseでOK
WS用は通常のProxyPassより前に記載で確実に動作する(ハズ)

<VirtualHost *:443>
    ServerName hogehoge.com

    SSLEngine on
    SSLProxyEngine On
    SSLProxyVerify none
    SSLProxyCheckPeerName off

    SSLCertificateFile /path/to/key/fullchain.pem
    SSLCertificateKeyFile /path/to/key/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf

    ProxyPreserveHost On

    RequestHeader set X-Forwarded-Proto "https"
    RequestHeader set X-Forwarded-Host "hogehoge.com"
    RequestHeader set X-Forwarded-For %{REMOTE_ADDR}s

    ProxyPassMatch ^/api2/json/.*/vncwebsocket wss://XXX.XXX.XXX.XXX:8006

    ProxyPass / https://XXX.XXX.XXX.XXX:8006/ retry=0
    ProxyPassReverse / https://XXX.XXX.XXX.XXX:8006/
</VirtualHost>

ドメインでWebUIアクセス

通ったやったー!

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?