简体   繁体   中英

ASP.NET customErrors behind nginx reverse proxy

I have a ASP.NET Server running on port 8080 on a machine, and for performance reasons an nginx caching reverse proxy running on port 80. Requests are done to port 80 and then, if not answered by the nginx cache, are passed to localhost:8080 via nginx proxy_pass directive.

This setup works fine so far, except for the ASP.NET customErrors. I'd like them to be "RemoteOnly", but due to the reverse proxy ALL requests will be originating from localhost and thus be local. I do pass the X-Real-IP and X-Forwarded-For via nginx, but ASP.NET seems to completely ignore this. Any idea?

It seems, when redirect from 8080 to 80 port occures, for IIS it sounds like local request. (IIS doesn't know about ngix anything). Therefore "remote request" will never occur in this case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM