cool_stuff_coming
cool_stuff_coming

Reputation: 453

apache https is getting redirect to http

I have configured https-vhosts.conf file in apache to point to non-standard port

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: enter image description here

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?

Upvotes: 1

Views: 53

Answers (1)

MrWhite
MrWhite

Reputation: 45829

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 is only the default when using the standard 443 port.)

For example:

Listen 8081 https

Reference:

Upvotes: 1

Related Questions