apache - CentOS 上 Apache SSL 代理背后的 Jira

标签 apache tomcat ssl proxy jira

如标题所示,我尝试让 Jira 在 Apache SSL 代理后面运行。

我能够在没有 SSL 的情况下使它工作,但现在我在 502 上苦苦挣扎。当我尝试访问 https://localhost/localhost:8080(这在我在 jira 中设置代理之前没有加密工作)https://127.0.0.1 和其他一些。

这是 Jira 连接器配置。

 <Connector port="8080"

               maxThreads="150"
               minSpareThreads="25"
               connectionTimeout="20000"

               enableLookups="false"
               maxHttpHeaderSize="8192"
               protocol="HTTP/1.1"
               useBodyEncodingForURI="true"
               redirectPort="8443"
               acceptCount="100"
               disableUploadTimeout="true"
               scheme="https"
               proxyName="localhost"
               proxyPort="443"
               />

   <!--

现在 Apache VHost 配置很抱歉新配置

ProxyRequests On
NameVirtualHost *:443

<VirtualHost *:443>
  SSLEngine on
  SSLCertificateFile /etc/pki/tls/certs/ca.crt
  SSLCertificateKeyFile /etc/pki/tls/private/ca.key
      SSLProxyEngine on

  ServerName localhost
  ServerAlias jira.ecoledelexcellence.ca
  ServerAlias 192.168.0.116

  ProxyRequests Off
  ProxyPreserveHost On

#  <Proxy *>
#    Order deny,allow
#    Allow from all
#  </Proxy>

  ProxyPass / https://127.0.0.1:8080/ retry=0
  ProxyPassReverse / https://127.0.0.1:8080/ retry=0

    <Location />
        Order allow,deny
        Allow from all
    </Location>

        #HTTP => HTTPS rewrite
        RewriteEngine On
        RewriteCond %{HTTPS} off
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>

感谢任何提示

最佳答案

进入 Tomcat,您应该在连接器配置中添加它是一个安全通道:

secure="true"

这告诉 Tomcat 即使 SSL 引擎没有在这个连接器上初始化,传入的连接也被认为是“安全的”。 proxyName 应该是机器的外部可见名称,如果 webapp 使用 schemeproxyNameproxyPort 变量来构造一个网址,见:Tomcat Proxy Support

http://tomcat.apache.org/tomcat-7.0-doc/config/http.html

Set this attribute to true if you wish to have calls to request.isSecure() to return true for requests received by this Connector. You would want this on an SSL Connector or a non SSL connector that is receiving data from a SSL accelerator, like a crypto card, a SSL appliance or even a webserver.

(也适用于 AJP 连接器)

HTTP:

对于 ProxyPass*,您不需要 https 中的“s”。 此外,您最后不需要重写,它会强制所有传入连接为纯 http。

关于apache - CentOS 上 Apache SSL 代理背后的 Jira,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20926592/

相关文章:

php - 尝试调用 SendGrid API 时出现 "Unsupported SSL protocol version"

apache - 从 https 重写为 http

css - 通过@font-face 加载 webfont 时,.woff 和 .ttf 文件抛出 NetworkError : 404 Not Found

java - 我的 maven webapp 项目在 tomcat7 上成功启动但 tomcat8 失败,为什么?

apache - 在 TOMCAT 7 上安装 Apache Archiva 作为 Web 应用程序

php - 如何调整我的 .htaccess 文件以允许子文件夹中的全功能网站

spring-mvc - Spring Boot "Request method ' GET'不支持”,同时通过 Catalina Connector 将 POST 请求重定向到 https 端口

Apache tomcat 打印随机空指针

linux - Drupal 7 重写不使用 .htaccess

java - 如何通过 SSH 连接在 Linux 上保持运行程序?