简体   繁体   English

nginx反向代理背后的ASP.NET customErrors

[英]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. 我在一台机器上的端口8080上运行了一个ASP.NET服务器,并且出于性能原因,在端口80上运行了nginx缓存反向代理。请求到端口80,然后,如果nginx缓存没有应答,则传递给localhost :8080通过nginx proxy_pass指令。

This setup works fine so far, except for the ASP.NET customErrors. 到目前为止,此设置工作正常,但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. 我希望它们是“RemoteOnly”,但是由于反向代理,所有请求都将来自localhost,因此是本地的。 I do pass the X-Real-IP and X-Forwarded-For via nginx, but ASP.NET seems to completely ignore this. 我通过nginx传递X-Real-IP和X-Forwarded-For,但ASP.NET似乎完全忽略了这一点。 Any idea? 任何想法?

It seems, when redirect from 8080 to 80 port occures, for IIS it sounds like local request. 看起来,当从8080重定向到80端口时,对于IIS,它听起来像是本地请求。 (IIS doesn't know about ngix anything). (IIS不知道任何关于ngix的事情)。 Therefore "remote request" will never occur in this case. 因此,在这种情况下永远不会发生“远程请求”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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