logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



[FIXED] Apache as a reverse proxy from HTTPS to HTTPS

 
Post new topic   Reply to topic    Apache Forum Index -> Apache



View previous topic :: View next topic  
Author Message
vasileiosg



Joined: 22 Feb 2016
Posts: 5
Location: NL,Voorburg

PostPosted: Mon 28 Mar '16 15:13    Post subject: [FIXED] Apache as a reverse proxy from HTTPS to HTTPS Reply with quote

Hello,

I have been struggling a lot with this matter. I have a service running on HTTPS on an internal server and I want to proxy to this server from outside. I thought it would have been as easy as doing the same for HTTP, but it seems I was wrong.

Please have a look on my vhost and if you have any ideas what am i doing wrong, please tell me!

<VirtualHost *>
ServerName something.domain.com
SSLCertificateFile /etc/apache2/ssl.crt/certificate.crt
SSLCertificateKeyFile /etc/apache2/ssl.key/certificate.key
SSLProxyEngine On
ProxyPreserveHost on
ProxyPass / http://mail.domain.com/
ProxyPassReverse / http://mail.domain.com/
ProxyRequests on
SSLEngine on
ProxyPass / https://mail.domain.com/
ProxyPassReverse / https://mail.domain.com/
</VirtualHost>

Thanks in advance


Last edited by vasileiosg on Thu 31 Mar '16 12:46; edited 1 time in total
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6604
Location: Germany, Next to Hamburg

PostPosted: Tue 29 Mar '16 11:50    Post subject: Reply with quote

You can not have two different Proxy*Pass to the same location in one vhost.

use https OR http, but not both.
Back to top
vasileiosg



Joined: 22 Feb 2016
Posts: 5
Location: NL,Voorburg

PostPosted: Tue 29 Mar '16 13:13    Post subject: Reply with quote

Didn't know that, thanks!

I tried also separating them to two different files (one for HTTP and the other for HTTPS)

That worked, but for some reason, it disables all other vhost files.

Here is the file

<VirtualHost *:443>
ServerName something.domain.com
SSLCertificateFile server.crt
SSLCertificateKeyFile server.key
ProxyRequests Off
SSLEngine On
ProxyPreserveHost On
ProxyPass / https://mail.domain.com/
ProxyPassReverse / https://mail.domain.com/
</VirtualHost>
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6604
Location: Germany, Next to Hamburg

PostPosted: Thu 31 Mar '16 12:13    Post subject: Reply with quote

You may post the config on http://apaste.info/ or http://pastebin.com/ so that we can check why the other vhosts vanish.
Back to top
vasileiosg



Joined: 22 Feb 2016
Posts: 5
Location: NL,Voorburg

PostPosted: Thu 31 Mar '16 12:45    Post subject: Reply with quote

i found the error:

<VirtualHost *:443>

should be:

<VirtualHost *>
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Apache
Page 1 of 1