Practical mod_perl / HTML Book /



previous page: 12.7.1.3. Security issues
  
page up: HTML Version of the book
  
next page: 12.7.3. Buffering Feature

12.7.2. Knowing the Proxypassed Connection Type


Let's say that you have a frontend server running mod_ssl, mod_rewrite, and mod_proxy. You want to make sure that your user is using a secure connection for some specific actions, such as login information submission. You don't want to let the user log in unless the request was submitted through a secure port.

Since you have to proxypass the request between the frontend and backend servers, you cannot know where the connection originated. The HTTP headers cannot reliably provide this information.

A possible solution for this problem is to have the mod_perl server listen on two different ports (e.g., 8000 and 8001) and have the mod_rewrite proxy rule in the regular server redirect to port 8000 and the mod_rewrite proxy rule in the SSL virtual host redirect to port 8001. Under the mod_perl server, use $r->connection->port or the environment variable PORT to tell if the connection is secure.

 

Continue to:

  • prev: 12.7.1.3. Security issues
  • Table of Contents
  • next: 12.7.3. Buffering Feature







TOP
previous page: 12.7.1.3. Security issues
  
page up: HTML Version of the book
  
next page: 12.7.3. Buffering Feature


Menu

  • HTML Book
  • PDF Book
  • Download Code
  • Table of Contents
  • Errata
  • mod_perl2 User's Guide
  • Sitemap

Search


Add to Google




Creative Commons License


Written by
Eric Cholet (Logilune) and
Stas Bekman (StasoSphere & Free Books).


[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007 StasoSphere.com