Developing ASP.NET MVC Web Applications — Question 125
You are developing an ASP.NET Core web application. The application includes a secure area only accessible to authenticated users.
The application must:
✑ Reside on the same server as the reverse proxy.
✑ Use a reverse proxy for caching and serving static content.
✑ Use basic authentication for the secure area.
✑ Use the HTTPS protocol for the secure area.
✑ Use the HTTPS protocol for all non-secure content.
You need to deploy the application.
Which two actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
Answer options
- A. Use the RewriteMiddleware from Microsoft.AspNetCore.Rewrite.
- B. Use the ForwardedHeaders middleware from Microsoft.AspNetCore.HttpOverrides.
- C. Use Http.sys as the web server for the application and Apache on Linux as the reverse proxy.
- D. Use Kestrel as the web server for the application and Nginx on Linux as the reverse proxy.
Correct answer: A, D
Explanation
The correct options are A and D. Option A is correct because the RewriteMiddleware is essential for managing URL rewriting, which is necessary for handling secure areas. Option D is also correct as Kestrel is well-suited for ASP.NET Core applications and Nginx is a robust reverse proxy for handling static content and caching. Options B and C do not meet the requirements since B does not directly address the secure area setup and C does not utilize the recommended web server configuration for this scenario.