FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 05-24-2012, 08:32 AM
"J. Bakshi"
 
Default How to port forward inside a folder ?

On Thu, 24 May 2012 11:23:47 +0300
"Jari Fredriksson" <jarif@iki.fi> wrote:

> On Thu, May 24, 2012 11:11, J. Bakshi wrote:
> > Hello,
> >
> > iptables port forwarding is running fine here.
> >
> > 192.168.1.1:82 forwarded to 192.168.1.2:80
> >
> > ``````````````````````
> > # for 82 > 80 of 192.168.1.2
> > iptables -A INPUT -p tcp -m tcp --dport 82 -j ACCEPT
> > iptables -A PREROUTING -t nat -i ${LAN_IFACE} -p tcp --dport 82 -j DNAT
> > --to 192.168.1.2:80
> > iptables -A FORWARD -p tcp --dport 82 -i ${LAN_IFACE} -j ACCEPT
> >
> > iptables -A PREROUTING -t nat -i ${WAN_IFACE} -p tcp --dport 82 -j DNAT
> > --to 192.168.1.2:80
> > iptables -A FORWARD -p tcp -d 192.168.1.2 --dport 80 -j ACCEPT
> > ```````````````````````````
> >
> > How can I forward inside a folder like
> > 192.168.1.1:82 forwarded to 192.168.1.2:80/mysite
> >
> > I have modified the rules as [.... --to 192.168.1.2:80/mysite ]
> > but no success. Am I missing anything ?
> >
>
> Yes, you have missed quite a bit about how networking works. You just
> can't do that with port forwarding or packet filtering. You have to do
> that URL rewrite to the "folder" in your application serving on port 80,
> probably Apache. iptables does not understand anything about folders.
>

Ok, thanks.
Then I'll do it by rewrite through .htaccess


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120524140236.16fa55a9@shiva.selfip.org">http://lists.debian.org/20120524140236.16fa55a9@shiva.selfip.org
 

Thread Tools




All times are GMT. The time now is 07:27 AM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org