Author |
|
faithless
Joined: 01 Jun 2006 Posts: 5
|
Posted: Fri 18 Aug '06 11:36 Post subject: http <--> https |
|
|
Hello,
I would like to know how I can do to automatically manage the transaction between http and https on my web site.
I have on my httpd.conf two virtual hosts the first one configured for le port 80
<VirtualHost _default_ :80>
…
</ VirtualHost>
And the second one for the port 443
<VirtualHost _default_ :443>
…
</ VirtualHost>
They are both configured to send connections to the same location on the server. I managed to have the http connection to my web site as http://www.mywebsite.com or as https://www.mywebsite.com .
The problem is that I would like to have only some web pages using https and not the whole web site. But because all my web pages are on the same folder I can not have the 443 virtual host redirecting connection to a different location. Is it possible to manage the transfer with mod_rewrite? If it is possible how can I do it?
Is it possible even if Apache is configured as a reverse proxy ?
Thanks in advance for your answers. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
|
Back to top |
|
faithless
Joined: 01 Jun 2006 Posts: 5
|
Posted: Fri 18 Aug '06 14:53 Post subject: |
|
|
don't worry for me
i already have the apache server as a reverse proxy with the mod_proxy module what i can not manage to have is my web application having the most of its pages in standard http and the other ones in https. i thing there is a way to do it with the mod_rewrite but i don't know how to use it.
Thanks in advance for your answers. |
|
Back to top |
|
SabinF
Joined: 03 May 2006 Posts: 37 Location: Timisoara (Romania)
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Fri 18 Aug '06 20:02 Post subject: |
|
|
I found a solution with mod_proxy_html with url rewriting. The config is a bot tricky, so here an example
Code: |
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule headers_module modules/mod_headers.so
LoadFile /usr/lib/libxml2.so
LoadModule proxy_html_module modules/mod_proxy_html.so
ProxyRequests off
ProxyPass /app1/ http://internal1.example.com/
ProxyPass /app2/ http://internal2.example.com/
ProxyHTMLURLMap http://internal1.example.com /app1
ProxyHTMLURLMap http://internal2.example.com /app2
<Location /app1/>
ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /app1/
ProxyHTMLURLMap /app1 /app1
RequestHeader unset Accept-Encoding
</Location>
<Location /app2/>
ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /app2/
ProxyHTMLURLMap /app2 /app2
RequestHeader unset Accept-Encoding
</Location>
|
|
|
Back to top |
|