0

My web application is setup for cookieless sessions:

<sessionState cookieless="true" regenerateExpiredSessionId="true" />

When I run a request direct to the web server, it works:

GET /TestWebProject/(S(qttapzkxlzjxb3mjugnjivav))/RequestReflector.aspx HTTP/1.1
Host: localhost
Connection: keep-alive
traceparent: 00-b940d55f7424696f950fd4a748983262-fb0808628749599f-00

Response:

HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 15 Jan 2025 00:56:13 GMT
Content-Length: 1262

However, if I run the request through the reverse proxy, it fails with a 404.4:

TTP Error 404.4 - Not Found
The resource you are looking for does not have a handler associated with it.
Most likely causes:

    The file extension for the requested URL does not have a handler configured to process the request on the Web server.

Things you can try:

    If the file extension does not have a handler associated with it, add a handler mapping for the extension.
    Verify that the handler associated with the file extension is properly installed and configured.
    Check the failed request tracing logs for additional information about this error. For more information, click here.

Detailed Error Information:
Module     IIS Web Core
Notification       MapRequestHandler
Handler    Not yet determined
Error Code     0x8007007b

GET http://localhost/TestWebProject/(S(qttapzkxlzjxb3mjugnjivav))/RequestReflector.aspx HTTP/1.1
Host: localhost
Connection: keep-alive
traceparent: 00-856739580de6a5867b4bf03fa6b3bb90-318d81b2ef8709da-00

Response

HTTP/1.1 404 Not Found
Cache-Control: private
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
Date: Wed, 15 Jan 2025 00:56:05 GMT
Content-Length: 5282

These HTTP requests and responses are from Wireshark capturing traffic to the server from the browser, and also from the reverse proxy to the server. I don't think they are particularly helpful, obviously the one that works doesn't write the full URL in the first line but I don't think that matters (although I have tried to modify that for testing, I cannot).

Unless something jumps out as being the problem, how can I debug what is going on in ASP.NET to see why it is returning a 404?

I already tried enabling failed request tracing, but it didn't really shed any light:

52.  -MODULE_SET_RESPONSE_ERROR_STATUS 


ModuleName
IIS Web Core 

Notification
MAP_REQUEST_HANDLER 

HttpStatus
404 

HttpReason
Not Found 

HttpSubStatus
4 

ErrorCode
The filename, directory name, or volume label syntax is incorrect.
 (0x8007007b) 

ConfigExceptionInf
1
  • WebForms was designed long before reverse proxies became popular, so such issues are not total surprises. You have to edit the question to show 1) your reverse proxy setup 2) detailed comparison of FRT log files from both successful/failed cases. Commented Jan 15 at 4:33

1 Answer 1

1

The error you are getting is not related with the cookie less setting. you can follow below steps to resolve the issue:

  1. Install ARR on your machine where you are trying to set the reverse proxy rule. you can download it from the below link:

https://www.iis.net/downloads/microsoft/application-request-routing

  1. After that go to the iis server, select server name

  2. Choose Application Request Routing module

enter image description here

  1. From rigt side Action pane choose server proxy settings

enter image description here

  1. Check Enable proxy and apply setting.

enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks, I have a follow up question. Adding ARR did solve it, and FWIW I forgot to say that removing the cookieless setting allowed it to work also (so it is something about cookieless). With that in mind can you think of a reason why cookieless might be involved? What is the ARR doing to allow it to work? I'm the author of the reverse proxy, and I'd like to make it work without requiring ARR.
@JimW In cookieless session ID is appended to the URL. maybe by using url rewrite reverse proxy unintentionally strip or misinterpret this URL structure that might cause his 404 error as backend will reject that url. to get more details i would like to suggest you could use the iis failed request tracing logs and compare success and failure logs. try to set the cookieless session like this in your project: <sessionState mode="InProc" cookieless="true" regenerateExpiredSessionId="true" timeout="30" />
Thanks, looking more closely at the failed request tracing I realized that the only real difference was indeed the request line GET localhost, the host being in the failed request and not the succeeding one. Once I stripped that out, it did indeed work.
@JimW glad to hear that it is working fine now

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.