Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is reverse proxy actually needed? #12311

Closed
effyteva opened this issue May 7, 2019 · 2 comments
Closed

Is reverse proxy actually needed? #12311

effyteva opened this issue May 7, 2019 · 2 comments

Comments

@effyteva
Copy link

effyteva commented May 7, 2019

Hi,

We're wondering if reverse proxy is actually required for most use cases and would appreciate additional information.

The Kerstel/Nginx documentation claims:
"Kestrel is great for serving dynamic content from ASP.NET Core. However, the web serving capabilities aren't as feature rich as servers such as IIS, Apache, or Nginx. A reverse proxy server can offload work such as serving static content, caching requests, compressing requests, and HTTPS termination from the HTTP server. A reverse proxy server may reside on a dedicated machine or may be deployed alongside an HTTP server."
https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-2.2

Could anyone please share some insights if this is actually relevant nowadays?

On our use case, we use Docker instances with external load balancing (AWS ALB).
Each docker instance has both Nginx and our ASP.NET Core application running.
We couldn't figure out the exact benefits of using Nginx.

1. Serving static content
As we're using an external CRN (AWS CloudFront), I assume static caching doesn't really have any actual benefits, does it?

2. Caching requests
I believe this is the same as serving static content, as dynamic content isn't cached on most scenarios (on our use case - all scenarios).

3. Compressing requests
ASP.NET Core has a response compression middleware, however - it claims "The performance of the middleware probably won't match that of the server modules. HTTP.sys server server and Kestrel server don't currently offer built-in compression support.".
Perhaps some benchmarks could be created to validate this claim.
https://docs.microsoft.com/en-us/aspnet/core/performance/response-compression?view=aspnetcore-2.2

4. HTTPS termination from the HTTP server
I assume most clients having load balancers can skip this part, as HTTPS termination can be done on the load balancer if needed.

Thanks!
Effy

@guardrex
Copy link
Collaborator

guardrex commented May 7, 2019

Hello @effyteva ... I recommend that you open this on a support forum, such as Stack Overflow, or discuss these points with devs on a support chat, such as Slack or Gitter.

I can provide a quick answer a few points:

Could anyone please share some insights if this is actually relevant nowadays?

It's the current guidance from engineering. On the next set of updates to the Linux docs, I'll ask them if they want to update that guidance.

static caching doesn't really have any actual benefits

Right, not if the app isn't statically caching anything. I built/managed all of my apps the same way but using Azure CDN. Same deal ... Static File Middleware was something that my apps barely used in Production.

Caching requests

Same answer ☝️ ... If the app isn't using Response Caching Middleware or some other caching mechanism via user code or a 3rd party lib, it isn't a relevant scenario.

Compressing requests

The guidance is correct, and no benchmarks can be provided because environments vary so widely. Devs should benchmark on their own scenarios.

HTTPS termination can be done on the load balancer

Yes ... that's very common in LB scenarios. We have a topic that helps devs config LB for ASP.NET Core: https://docs.microsoft.com/aspnet/core/host-and-deploy/proxy-load-balancer

I'm going to close here, but your best bet is to ask where many, many more dev 👀 will see your questions. Open on SO or ask on Slack/Gitter, I'm sure you'll get a lot of great feedback.

@guardrex guardrex closed this as completed May 7, 2019
@effyteva
Copy link
Author

effyteva commented May 7, 2019

Thank you, moving here:
https://stackoverflow.com/questions/56027292/is-reverse-proxy-actually-needed-on-asp-net-core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants