我使用tomcat和apache设置了jira服务器。当我输入网址jira.example.com时,它会将我带到https://jira.example.com//secure/Dashboard.jspa,因为网址,我会收到信息中心错误。如果我输入jira.example.com:8080,它会将我带到正确的网址。 http://jira.example.com:8080/secure/Dashboard.jspa问题出在哪里?
<IfModule mod_proxy.c>
ProxyRequests On
<VirtualHost *:80>
ServerName jira.example.com
ServerAlias jira jira.c11.example.com
ProxyPreserveHost On
ProxyRequests Off
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
ProxyTimeout 60
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://jira.example.com/$1 [R,L]
ErrorLog /var/log/httpd/jira.example.com-error_log
CustomLog /var/log/httpd/jira.example.com-access_log combined
</VirtualHost>
<VirtualHost *:443>
ServerName jira.example.com
ServerAlias jira jira.c11.example.com
ServerSignature On
SSLEngine on
SSLCertificateFile /etc/httpd/conf/ssl.crt/star.example.com.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/star.example.com.key
SSLCertificateChainFile /etc/httpd/conf/ssl.crt/thawte_chain_bundle.crt
SetEnvIf User-Agent .*MSIE.* nokeepalive ssl-unclean-shutdown
ErrorLog /var/log/httpd/ssl-jira.example.com-error_log
CustomLog /var/log/httpd/ssl-jira.example.com-access_log combined
SSLProxyEngine on
<Proxy *>
Order deny,allow
Allow from all
#Allow from .your_domain.com
</Proxy>
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
答案 0 :(得分:1)
在主虚拟主机中,您有重写条件可将非ssl流量重定向到https:
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://jira.example.com/$1 [R,L]
删除它会删除重定向。
答案 1 :(得分:1)
我刚才面对这个问题。
在Jira中正确设置了基本网址,但我仍然收到有关它的信息与用于访问界面的信息不同。
问题是我没有使用代理参数设置Tomcat连接器。添加以下连接器解决了我的问题(当然使用jira重启)
<Connector acceptCount="100" connectionTimeout="20000"
disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" port="8081" protocol="HTTP/1.1"
redirectPort="8443" useBodyEncodingForURI="true"
<!-- This is the important part -->
proxyName="jira.mybuisness.com" proxyPort="443" scheme="https"/>
这是对Jira安装的唯一修改,与https代理相关的所有其他配置都由apache处理。
以下是启用了mod_ssl
mod_proxy
mod_proxy_http
和mod_proxy_connect
的相关apache配置。
<VirtualHost 192.168.5.143:443>
ServerName https://jira.mybuisness.com
# SSLEngine is not specified in jira's documentation but was necessary for me
SSLEngine On
SSLProxyEngine On
SSLCertificateFile /path/to/my/certificate/cacert_https.pem
SSLCertificateKeyFile /path/to/private/privkey_https.pem
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://myjiraserver:8081/
ProxyPassReverse / http://myjiraserver:8081/
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ErrorLog "logs/jira-error.log"
CustomLog "logs/jira-access.log" common
</VirtualHost>
<VirtualHost 192.168.5.143:80>
ErrorLog "logs/jira-error.log"
CustomLog "logs/jira-access.log" common
ServerName superjiratest.mybuisness.com
Redirect permanent / https://jira.mybuisness.com/
</VirtualHost>
我使用的是自签名密钥,因为这是一个测试设置,但它与验证的付费密钥几乎相同。
我希望这会对某人有所帮助,我在这方面失去了很多时间。我想OP已经在近一年后找到了解决方案。