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

MWG: How do I rewrite a 301 redirect with a reverse proxy?

Jump to solution

Hello,

I have deployed a Web Gateway in reverse proxy, everything appears to work fine except when a user browses to a folder URL without the trailing slash... for example:

Looking at a pcap (attached image), the server is responding with a 301 header which the MWG is "missing" - i.e. not re-writing - so the client browser honours the redirect and tries a direct non-proxied connection.

Does anyone know how to fix?

I am running MWG 7.4.1, the test was using M$ Server 2008 running IIS. The same symptons are exibited when running Ubuntu/apache as the content server..

The MWG is running https://community.mcafee.com/docs/DOC-5205 as it's configuration.

Thanks in Advance,

Nick

0 Kudos
1 Solution

Accepted Solutions
asabban
Level 17

Re: MWG: How do I rewrite a 301 redirect with a reverse proxy?

Jump to solution

The problem is not with MWG or the Web Server, but the web site. This always occurs when absolute links are used or the web site redirects to an absolute URL. The 301 you indicated could simply send Location: /nbtest/ but instead of that it sends the absolute URL to the browser, so the browser follows as requested.

On MWG you can catch a 301 response and rewrite it:

2014-02-14 11_35_05-McAfee _ Web Gateway - MWG7-Reverse - 10.150.64.147.png

You read the header, write it into a variable, correct it and in the final rule delete the original Location header and inject a new one with a new value.

Best,

Andre

Nachricht geändert durch asabban on 14.02.14 11:39:04 MEZ
0 Kudos
2 Replies
asabban
Level 17

Re: MWG: How do I rewrite a 301 redirect with a reverse proxy?

Jump to solution

The problem is not with MWG or the Web Server, but the web site. This always occurs when absolute links are used or the web site redirects to an absolute URL. The 301 you indicated could simply send Location: /nbtest/ but instead of that it sends the absolute URL to the browser, so the browser follows as requested.

On MWG you can catch a 301 response and rewrite it:

2014-02-14 11_35_05-McAfee _ Web Gateway - MWG7-Reverse - 10.150.64.147.png

You read the header, write it into a variable, correct it and in the final rule delete the original Location header and inject a new one with a new value.

Best,

Andre

Nachricht geändert durch asabban on 14.02.14 11:39:04 MEZ
0 Kudos
linickx
Level 7

Re: MWG: How do I rewrite a 301 redirect with a reverse proxy?

Jump to solution

That's exactly what I need - Thanks!

0 Kudos