You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Robert Becskei <br...@stcable.co.yu> on 2005/09/26 15:59:06 UTC

[users@httpd] apache mod_rewrite

Hello everyone,

I'm no expert at httpd , I know how to set up basic stuff but that is all I know how to do. So I ask you to please help me solve this problem.

I have 20 video camera servers in my lan, all of them have a software that can be used to access them by default on port 80.

I have only one public ip address.

I'm doing port forwarding currently in the following way:

all trafic that goes to xxx.xxx.xxx.xxx:10022 is redirected to 192.168.56.10:80 (xxx.xxx.xxx.xxx = public ip).

what I would like to do is to be able to access xxx.xxx.xxx.xxx:10022 like camera1.mydomain.com.

How do you do this with mod rewrite?

Sincerely
Robert B

Re: [users@httpd] apache mod_rewrite

Posted by Joshua Slive <js...@gmail.com>.
On 9/26/05, Robert Becskei <br...@stcable.co.yu> wrote:
>
> Hello everyone,
>
> I'm no expert at httpd , I know how to set up basic stuff but that is all I
> know how to do. So I ask you to please help me solve this problem.
>
> I have 20 video camera servers in my lan, all of them have a software that
> can be used to access them by default on port 80.
>
> I have only one public ip address.
>
> I'm doing port forwarding currently in the following way:
>
> all trafic that goes to xxx.xxx.xxx.xxx:10022 is redirected to
> 192.168.56.10:80 (xxx.xxx.xxx.xxx = public ip).
>
> what I would like to do is to be able to access xxx.xxx.xxx.xxx:10022 like
> camera1.mydomain.com.
>
> How do you do this with mod rewrite?

I believe you want a reverse proxy, which is discussed in detail here:
http://www.apacheweek.com/features/reverseproxies

You can also do it with mod_rewrite if you prefer.  It would look
something like:
RewriteCond %{HTTP_HOST} ^camera1.mydomain.com$ [NC]
RewriteRule ^/(.*) http://xxx.xxx.xxx.xxx:10022:/$1
ProxyPassReverse / http://xxx.xxx.xxx.xxx:10022/

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org