Redirect https port to another web server

https
v6
webserver

(Alessandro Nunes De Oliveira) #1

NethServer Version: 6.9
Module: your_module

how to redirect port 433 from https to another server?
I have a nethserver server version 6.9 working as a firewall
I installed a web server inside my network, http port redirects
Normally for my web server but the https port does not redirect.
I enter the name of my site. https://www.meusite.com and it opens the apache server nethserver test
shot the S leaving http://www.meusite.com and my site opens normal
redirect


network


(Saito Benkei) #2

You wrote 433 instead of 443 in your "Port de origem"
If you want to retain 433 you have to write https://www.meusite.com:433 from internet or have to modify your rule changing 433 in 443.

or

You can try this on Nethserver NG 6.x removing redirections of 80 and 433 ports:

vi /etc/httpd/conf.d/proxy-pass.conf

Add the following lines:

Include nethserver.d/00default:80.vhost
Include nethserver.d/00default:443.vhost
    
<Virtualhost *:80>
  ServerName www.meusite.com
  ProxyPreserveHost On
  ProxyPass / http://172.16.16.2/
  ProxyPassReverse / http://172.16.16.2/
</VirtualHost>

<Virtualhost *:443>
  ServerName www.meusite.com
  ProxyPreserveHost On
  ProxyPass / https://172.16.16.2/
  ProxyPassReverse / https://172.16.16.2/
</VirtualHost>

Save the file then give digit this command:

service httpd reload


(Alessandro Nunes De Oliveira) #3

thank you so much.
it worked here


(Michael Träumner) #4

Great news,
please mark it as solved.


(Alessandro Nunes De Oliveira) #5

I have a small problem with the ssl certificate now, it takes the netserver certificate instead of the site certificate :disappointed_relieved:


(Saito Benkei) #6

Strange…
I implemented same configuration (proxy-pass) on one of my customer just to manage certificates on two differents servers inside the lan with letsencrypt and all works correctly…


(Michael Träumner) #7

What error message did you get?