我有一个使用tomcat和Apache的jira服务器设置。 当我inputurljira.example.com它把我带到https://jira.example.com//secure/Dashboard.jspa ,我得到仪表板的错误,因为该url。 如果我inputjira.example.com:8080,它会将我带到正确的url。 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/
在您的主虚拟主机中,您有重写条件将非SSL通信重定向到https:
RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://jira.example.com/$1 [R,L]
删除这将删除重定向。
我刚才正面临着这个问题。
基本的URL在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处理。
这里是相关的Apache配置与mod_ssl
mod_proxy
mod_proxy_http
和mod_proxy_connect
启用。
<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在将近一年后已经找到了解决方案。