简体   繁体   English

apache https 正在重定向到 http

[英]apache https is getting redirect to http

I have configured https-vhosts.conf file in apache to point to non-standard port我在 apache 中配置了 https-vhosts.conf 文件指向非标准端口

ProxyRequests Off
ProxyPreserveHost On
Listen 8081
<VirtualHost *:8081>
  RequestHeader set X-Forwarded-Proto "https"                   ####this is needed for our app
  ServerName test.apa.com
  ProxyPass / http://10.1.1.5:8443
  ProxyPassReverse / http://10.1.1.5:8443
  SSLEngine on
  SSLCertificateFile /etc/ssl/certs/server.crt
  SSLCertificateKeyFile /etc/ssl/private/server.key
</VirtualHost>

However when I try to access url in chrome: https://test.apa.com:8081 , i get below error:但是,当我尝试在 chrome: https://test.apa.com:8081中访问 url 时,出现以下错误: 在此处输入图像描述

Also, the url in address bar shows as http://test.apa.com:8081.However , when I change http to https and try to access...it works fine and browser shows https://test.apa.com:8081 . Also, the url in address bar shows as http://test.apa.com:8081.However , when I change http to https and try to access...it works fine and browser shows https://test.apa. com:8081

Please suggest on what the issue is with the configuration of virtual hosts?请建议虚拟主机的配置有什么问题?

 Listen 8081

Since you are using a non-standard port for HTTPS, you need to specify this in the Listen directive, otherwise it defaults to http .由于您为 HTTPS 使用非标准端口,因此您需要在Listen指令中指定此端口,否则默认为http ( https is only the default when using the standard 443 port.) https只是使用标准 443 端口时的默认值。)

For example:例如:

Listen 8081 https

Reference:参考:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM