cancel
Showing results for 
Search instead for 
Did you mean: 
jutley
Level 7

Remove Via Header rule not working to hide our proxy IP

Jump to solution

Hello, I set up a rule based on another thread on this forum on how to hide our proxy's IP address and the client's IP as well. The rule we set up according to the screenshot attached did hide the client IP (X-Forwarded-For) but the proxy ip is still showing up when we go to whatsmyip.com (see 2nd screenshot)

Any ideas on what I might be doing wrong?

Thanks!

0 Kudos
1 Solution

Accepted Solutions
eelsasser
Level 15

Re: Remove Via Header rule not working to hide our proxy IP

Jump to solution

The rule has changed in 7.2.

There is now a Proxy Control setting that can do this.

Line 1 changes the value to just the word "Proxy"

Line 2 removes it all together.

Pick one, but not both.

Remove Header: Via and X-Forwarded-For
[Ruleset to remove header. This can also be done globally in the proxy configuration settings]
Enabled
Applies to Requests: True / Responses: True / Embedded Objects: False
Always
EnabledRuleActionEventsComments
EnabledAlter Header: Via
Always
ContinueHeader.RemoveAll("Via")
Proxy Control<Disable Via Header>
Header.Add("Via","Proxy")
This rule changes the 'Via' header.
DisabledRemove Header: Via
Always
ContinueHeader.RemoveAll("Via")
Proxy Control<Disable Via Header>
This rule removes the 'Via' header.
EnabledRemove Header: X-Forwarded-For
1: Header.Exists("X-Forwarded-For") equals true
ContinueHeader.RemoveAll("X-Forwarded-For")This rule removes the 'X-Forwarded-For' header.

It is usually recommended to keep the Via header in just in case you have the potential for a proxy loop on your network.

0 Kudos
6 Replies
eelsasser
Level 15

Re: Remove Via Header rule not working to hide our proxy IP

Jump to solution

The rule has changed in 7.2.

There is now a Proxy Control setting that can do this.

Line 1 changes the value to just the word "Proxy"

Line 2 removes it all together.

Pick one, but not both.

Remove Header: Via and X-Forwarded-For
[Ruleset to remove header. This can also be done globally in the proxy configuration settings]
Enabled
Applies to Requests: True / Responses: True / Embedded Objects: False
Always
EnabledRuleActionEventsComments
EnabledAlter Header: Via
Always
ContinueHeader.RemoveAll("Via")
Proxy Control<Disable Via Header>
Header.Add("Via","Proxy")
This rule changes the 'Via' header.
DisabledRemove Header: Via
Always
ContinueHeader.RemoveAll("Via")
Proxy Control<Disable Via Header>
This rule removes the 'Via' header.
EnabledRemove Header: X-Forwarded-For
1: Header.Exists("X-Forwarded-For") equals true
ContinueHeader.RemoveAll("X-Forwarded-For")This rule removes the 'X-Forwarded-For' header.

It is usually recommended to keep the Via header in just in case you have the potential for a proxy loop on your network.

0 Kudos
jutley
Level 7

Re: Remove Via Header rule not working to hide our proxy IP

Jump to solution

Thank you! That did the trick.

0 Kudos
stifi
Level 7

Re: Remove Via Header rule not working to hide our proxy IP

Jump to solution

Could you spend some explainations about that proxy control please? Just in case I would like to remove the via header, adding Header.RemoveAll("Via") is working for me pretty fine. So what is this proxy control exactly doing and in what situations does I really need it?

Thanks, Stefan

0 Kudos
asabban
Level 17

Re: Remove Via Header rule not working to hide our proxy IP

Jump to solution

Hello,

Header.RemoveAll works fine until 7.2. It also should work fine for Via Header that exist in the request that come into MWG, but the rule will no longer prevent MWG from adding Via headers itself starting with 7.2. The Via Header is added by the proxy component, not by the rule engine. With the proxy control settings you can influence what the proxy does - in this case you can tell it to not add a Via header to the outgoing connection. If you don't do it you can remove the header in the rule engine, but the proxy will add the header again, because it does not know that you don't want this.

Best,

Andre

0 Kudos
alex_vani
Level 7

Re: Remove Via Header rule not working to hide our proxy IP

Jump to solution

Does anyone know if the ruleset works on version 7.3.x?

Thank you !

0 Kudos
andyclements
Level 12

Re: Remove Via Header rule not working to hide our proxy IP

Jump to solution

Both ways should still work on 7.3, as well as the rule set.

0 Kudos