Apache ルールを使用して、Kallithea バックエンド サーバー (Git/Mercurial リポジトリの管理に便利) のアドレスを隠そうとしています。https://sub.domain1.com/gitreposからhttps://sub.domain2.com/への URL リダイレクトがあります。
Atm、 https://sub.domain1.com/gitrepos/path/to/repo にアクセスしようとすると、https://sub.domain2.com/path/to/repoにリダイレクトされます
2 番目のサーバー アドレスを非表示にする方法を探しています。https://sub.domain2.com/path/to/repoに明示的にリダイレクトされることなく、 https://sub.domain1.com/gitrepos/path/to/repoにアクセスしたい
Apache の設定をいくつか試してみましたが、うまくいきません。バックエンド サーバー側で処理できるものなのか、実際にリダイレクトするサーバーで処理できるものなのかわかりません。
これが私の現在の構成です:
<VirtualHost *:80>
ServerName git-domain2.com
ServerAlias git-domain2
Redirect permanent / https://git-domain2.com/
</VirtualHost>
<VirtualHost *:443>
ServerName git-domain2.com
ServerAlias git-domain2
<Proxy *>
Require all granted
</Proxy>
ProxyPreserveHost On
ProxyPass /gitrepos http://domain2.com:5000/ connectiontimeout=20 timeout=300
ProxyPassReverse /gitrepos http://domain2.com:5000/
#kallithea instance
ProxyPass / http://domain2.com:5000/ connectiontimeout=20 timeout=300
ProxyPassReverse / http://domain2.com:5000/
#to enable https use line below
SetEnvIf X-Url-Scheme https HTTPS=1
#LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /etc/pki/tls/certs/domain2.com.crt
SSLCertificateKeyFile /etc/pki/tls/private/domain2.com.key
</VirtualHost>
助けてくれてありがとう。