0
我正在設置jira服務器的過程中,並將使用apache成爲tomcat服務的代理。我有我的Apache設置完成90%,但不能鍛鍊最終配置。目標是讓用戶能夠訪問FQDN,別名或完全限定的別名,但URL始終會重寫爲DNS別名。例如,用戶瀏覽:apache重寫規則和代理通行證
http://jira.domian.com rewrite to https://jira
http://nbsrvjira-07v rewrite to https://jira
http://nbsrvjira-07v.diasemi.com rewrite to https://jira
以上所有的工作,不過下面失敗:
https://jira.domian.com rewrite to https://jira
https://nbsrvjira-07v rewrite to https://jira
https://nbsrvjira-07v.diasemi.com rewrite to https://jira
除非使用特定的URL,將在應用程序中引起問題,Apache的配置低於:
的HTTP到HTTPS重定向:
<VirtualHost *:80>
ServerName nbsrvjira-07v.domain.com
ServerAlias jira-test jira-test.domain.com
ErrorLog "/var/log/httpd/nbsrvjira-07v.domain.com_error.log"
ServerSignature Off
CustomLog "/var/log/httpd/nbsrvjira-07v.domain.com_access.log" combined
RewriteEngine On
RewriteRule ^/(.*) https://jira-test/ [noescape,last,redirect=302]
</VirtualHost>
到代理通的HTTPS:
VirtualHost *:443>
ServerName nbsrvjira-07v.domain.com
ServerAlias jira jira.domain.com
ErrorLog "/var/log/httpd/nbsrvjira-07v.domain.com_error.log"
ServerSignature Off
CustomLog "/var/log/httpd/nbsrvjira-07v.domain.com_access.log" combined
SSLEngine On
SSLCertificateFile "/etc/pki/tls/certs/nbsrvjira-07v.domain.com.cert"
SSLCertificateKeyFile "/etc/pki/tls/private/nbsrvjira-07v.domain.com.key"
RewriteEngine On
ProxyPass /http://localhost:8080/ connectiontimeout=5 timeout=300
ProxyPassReverse/http://localhost:8080/
</VirtualHost>
我已經嘗試過https配置中的各種重寫規則,但似乎沒有工作。有人可以幫忙嗎?
克里斯
我嘗試過,但沒有幫助,我得到了重複的虛警警告。 – user3216306
好的。奇怪你有重複的主機。你真的在不同的主機上使用不同的ServerName嗎? – prerik
我總是將servername設置爲ServerName nbsrvjira-07v.domain.com – user3216306