Detect URL in a NAT rule

Hello,

i try detect url in a nat rule. do you think it’s possible ?
(content in mangle rule to mark connexion but it’s not perfect)

Thanks in advance

c-dric

I am not certain I understand what you want. Do you want to see if the mangle rules are working on outbound routings?
http://www.whatismyip.com/

ADD: Or are you trying to see what website is requested when each rule is used?

if you want to make rules for websites, and resolve the dns name, you can use some scripts, and the resolve features.

yes thank you.
i have only one external ip and 3 web servers.
i want to detect the dns name and to nat to each server depending of the host name.
do you have sample script approching this case ?
and how to call a script from a rule ?

If you want to display multiple websites with different URLs on one ip address (like I do), then I have found the job is best done by Apache in one server. That is beyond the scope of this forum tho.

i know virtual hosting with apache, but it’s not the solution.
i really would like to do this through the routerboard !

I don’t use this, but this is what http://www.w3.org says about http headers. If the packet is to/from http://www.w3.org, then this will be in the packet:

Host: www.w3.org

There is a colon that is hard to see after the “Host”.
My reference: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
EDIT: I changed it a little so the colon is easy to see.

Thank you. i’ll try.