logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


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

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: http <--> https
Author
faithless



Joined: 01 Jun 2006
Posts: 5

PostPosted: Fri 18 Aug '06 11:36    Post subject: http <--> https Reply with quote

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

PostPosted: Fri 18 Aug '06 14:44    Post subject: Reply with quote

of cause you can run apache as reverse proxy. See
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

If there are further questions. You can ask again!
Back to top
faithless



Joined: 01 Jun 2006
Posts: 5

PostPosted: Fri 18 Aug '06 14:53    Post subject: Reply with quote

don't worry for me Wink
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)

PostPosted: Fri 18 Aug '06 15:13    Post subject: Reply with quote

Maybe this will help you in some way:

http://www.blackdot.be/?inc=apache/forcessl.htm
Back to top
James Blond
Moderator


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

PostPosted: Fri 18 Aug '06 20:02    Post subject: Reply with quote

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


Reply to topic   Topic: http <--> https View previous topic :: View next topic
Post new topic   Forum Index -> Apache