0

I am creating a Reverse Proxy box with apache and i have some questions about that:

  • How can i load some files, say robots.txt, off the reverse proxy box instead of the actual host?
  • Would it be wise to allow loading of .htaccess at the proxy box? What about the rewrite rules they proxy boxes have?
  • Where should i put my rewrite rules? in vhost or in .htaccess? If i allow .htaccess loading from proxy boxes, won't it be problem to have 2 .htaccess? I think only one of that will be loaded.
  • What about reverse proxying sites that are on http as well as https? Do i need some special setup?
  • Are there any issues that i should watch out for while creating a reverse proxy? I already know about using mod_proxy_html to correct the links in html files.

1 Answer 1

2

How can i load some files, say robots.txt, off the reverse proxy box instead of the actual host?

ProxyPass /robots.txt http://someotherserver.com/robots.txt

or

RewriteEngine On
RewriteCond %{REQUEST_URI} .*robots\.txt$ [NC]
RewriteRule (.*) http://otherhost.com/$1 [P]

Would it be wise to allow loading of .htaccess at the proxy box? What about the rewrite rules they proxy boxes have?

This actually shouldn't matter; .htaccess is just an "extended" apache configuration, so each server will handle their own rewrite rules individually. If your configuration allows for the .htaccess file to be read prior to the proxy, both will execute.

Where should i put my rewrite rules? in vhost or in .htaccess? If i allow .htaccess loading from proxy boxes, won't it be problem to have 2 .htaccess? I think only one of that will be loaded.

Pretty much same as above, if you write .htaccess pages that will actually LOAD on both servers, then they will both work independently.

What about reverse proxying sites that are on http as well as https? Do i need some special setup?

No real issues here. Its all server-side so it doesn't change the interaction with the client.

Are there any issues that i should watch out for while creating a reverse proxy? I already know about using mod_proxy_html to correct the links in html files.

nothing that i can think of off the top of my head.

2
  • What about having a reverse proxy for a site that uses http as well as https? Do i need to have to vhost e.g. 80 and 443 and proxypass them both? Or is there a simple trick?
    – Shoaibi
    Jun 19, 2010 at 21:49
  • @Shoaibi look at the file conf/extra/httpd-ssl.conf and also note in httpd.conf there's a Include conf/extra/httpd-ssl.conf directive that is initially commented out. You'll need to use the SSLProxyEngine On directive I believe if you want SSL, as well as the relevant certs setup. Jun 14, 2011 at 11:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .