RewriteProxy - 404 pages not passing through

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 18
Joined: 17 Dec 2012, 14:43

RewriteProxy - 404 pages not passing through

25 Feb 2013, 17:04

Hi,

We have a RewriteProxy setup to send all *.whatever files through our proxy (destination configured by a hostmap which isnt important)

RewriteProxy (/.*\.whatever.*|/.*\.whatever1.*) ${hostmap:%2}$1 [H, A]


Im noting the RewriteProxy works great for all regular 200 status requests. However, I noticed today that we have an error page that we want proxied through, and its returning a status code of 404. The proxy debug has the correct proxy URL, but a blank page is rendered to the client (with r404 status).

Does RewriteProxy not grab 404 status code pages?

If not, can we enable it so that it can?

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: RewriteProxy - 404 pages not passing through

25 Feb 2013, 17:30

hello,

What is your IIS version?

Please, provide rewrite.log for the testing request.
Logging issues described in FAQ

Regards
Andrew

User avatar
Posts: 18
Joined: 17 Dec 2012, 14:43

Re: RewriteProxy - 404 pages not passing through

25 Feb 2013, 19:16

IIS7,

I will send you the log in PM

User avatar
Posts: 18
Joined: 17 Dec 2012, 14:43

Re: RewriteProxy - 404 pages not passing through

25 Feb 2013, 21:51

Could it be that Helicon does not process "Error pages". That is possibly it.

We have an error page setup, lets say "error.boom"

We have *.boom mapped via helicon, those rules dont seem to be processed for the error pages. Perhaps this all happens after Helicon ISAPIRewrite has done its magic?

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: RewriteProxy - 404 pages not passing through

26 Feb 2013, 11:24

Hello,

ISAPI_Rewrite is capable of returning custom 404 pages.
I've seen your logs and they show that everything has been proxyed correctly. there's something else, not necessarily in ISAPI_Rewrite. If you can access your 404 directly from front-end it should work fine.

Regards
Andrew

User avatar
Posts: 18
Joined: 17 Dec 2012, 14:43

Re: RewriteProxy - 404 pages not passing through

26 Feb 2013, 14:30

We hit an HTML file, 404 is issued.

IIS serves the customer 404 page, error.whatever

*.whatever files all need to be proxied by Helicon in order to be rendered. In this case hitting it directly is rendering. Also if I switch the error page to "error.html" instead of "error.whatever" it renders correctly.

I don't see anything in the logs for Helicon on the "error.whatever" page. The custom 404 we have setup needs to be Proxied by Helicon. Is perhaps that not working?

I am using NotificationType=PREPROC_HEADERS if that matters.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: RewriteProxy - 404 pages not passing through

26 Feb 2013, 15:22

Well, the log states, that the entry in the mapfile is found... it's proxyed to the specified path.

(5) map lookup OK: map=h[txt] key=staging.yoursite.org -> val=XX.XXX.XXX.XXX:XXXX/websitecontent/yoursite.org/htdocs
(2) forcing proxy-throughput with XX.XXX.XXX.XXX:XXXX/websitecontent/yoursite.org/htdocs/404/html404.cfm


Is it the page you need? Or what is the landing page you need?
If yes, than ISAPI_Rewrite is working fine and there's nothing you can setup.

NotificationType=PREPROC_HEADERS is a magical directive that allows IIS to process requests prior to ISAPI_rewrite. There might be a small chance of it affecting your situation. We may suggest commenting out this line for the sake of experiment.

Regards
Andrew

User avatar
Posts: 18
Joined: 17 Dec 2012, 14:43

Re: RewriteProxy - 404 pages not passing through

26 Feb 2013, 15:42

That's the right file. That example was from a direct hit to the page, which is proxied correctly. The only time it is seemingly failing is if IIS returns that exact same page as a custom error page.

User avatar
Posts: 18
Joined: 17 Dec 2012, 14:43

Re: RewriteProxy - 404 pages not passing through

26 Feb 2013, 16:02

I tried turning off preproc headers with no luck. If I request the error page directly, it works great and I see that request in the Helicon logs.

If I hit an invalid page, I see that request in the Helicon logs.

However, I do not see the request for the 404 page in the Helicon logs.

I have IIS setup to "Execute a URL on this site". I believe this does work however with a file extension that IIS has a handler for, so maybe it's something with that. I'll keep digging.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: RewriteProxy - 404 pages not passing through

27 Feb 2013, 10:14

Please, contact us using helpdesk or email to provide with remote access to your server.
We' d be happy to help you in resolving this issue.

Regards
Andrew

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: RewriteProxy - 404 pages not passing through

28 Feb 2013, 10:26

Would you, please, also, clarify what is "Execute a URL on this site".

Regards
Andrew

User avatar
Posts: 18
Joined: 17 Dec 2012, 14:43

Re: RewriteProxy - 404 pages not passing through

08 Mar 2013, 20:36

"Execute a URL on this site" is a method of setting up your 404 error page in IIS7.

My testing is concluding that ISAPIRewrite does NOT process 404 error pages.

I setup an error page at: /new404/404.html

I created a simple html page at: /redirected.html

I created a rule to redirect the error page to the redirected.html:

RewriteRule ^new404/404.html$ /redirected.html [NC,R=301,L]

If I hit /new404/404.html from a browser I'm redirected as I'd expect.

If I hit a fake page, which 404's I get the contents of /new404/404.html, but no redirect or anything, and the original requested page is in the Helicon logs, but not a second request for the 404 page, new404/404.html.

It would appear that Helicon ISAPIRewrite does not "get" the request for the 404 page, and therefore will not process rules based on it. This is really bad for me because I'm trying to proxy my error pages using Helicon.

See if you can replicate this please, the test is pretty quick to setup. Any help is appreciated.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: RewriteProxy - 404 pages not passing through

11 Mar 2013, 21:46

Let me get it right. If you turn off the "Execute URL on a site" everything works?
Can you avoid this feature ?

Regards
Andrew

User avatar
Posts: 18
Joined: 17 Dec 2012, 14:43

Re: RewriteProxy - 404 pages not passing through

12 Mar 2013, 01:46

That's just how you setup error pages in IIS, you can't turn it off.

I'm not sure we're on the same page.

Error pages being served by IIS aren't being handled by ISAPRewrite.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: RewriteProxy - 404 pages not passing through

12 Mar 2013, 10:34

I'm sorry, I might not have put it right.
I meant to switch to "Insert content from static file". Can you do that?

Regards
Andrew

User avatar
Posts: 18
Joined: 17 Dec 2012, 14:43

Re: RewriteProxy - 404 pages not passing through

12 Mar 2013, 16:04

That works but it is not handled by ISAPIRewrite (Im not even sure a web request is made in that case).

I need my error page proxied out via ISAPIRewrite. My error page uses a scripting language and we proxy all requests to this scripting language out to another machine.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: RewriteProxy - 404 pages not passing through

13 Mar 2013, 13:46

You might be right. I could be just taking too much time and the focus is getting loose on my side due to a large number of other customers.
Lets try to do it once again, as I'm getting confued with all those details along the line.

Please, provide us with the rules, logs, basic concept using email or helpdesk all in one peace(our developers will try to replicate your environment):
1. What is the initial request
2. what should happen on front-end (if, for example, it's a static page)
3. what back-end is supposed to do
4. what does it mean "*.boom mapped via helicon"?

Regards
Andrew

User avatar
Posts: 18
Joined: 17 Dec 2012, 14:43

Re: RewriteProxy - 404 pages not passing through

13 Mar 2013, 13:57

OK, I'll shoot over a request via the ticket system

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 16 guests