Use the iis reverse proxy. net core application, iiscore

Source: Internet
Author: User

Use the iis reverse proxy. net core application, iiscore

. Net core is actually a self-hosted web application, instead of a web site. Therefore,. net core can be directly deployed as a system service. However, in practice, to support multiple web applications and unified management for the same port, it is still necessary to integrate with a server, such as iis and Jexus. Therefore,. net core is no longer hosted by iis workers, but is managed by a self-hosted Web server (Kestrel ). Iis acts as a reverse proxy to forward requests to Kestrel. The most important role here is AspNetCoreModule, which is one of the IIS modules. After a request enters IIS, it is immediately forwarded and quickly redirected to ASP. in the. NET Core project, we do not need to set an application pool to host our code at this time. It is only responsible for forwarding requests.

Before deployment, make sure that your IIS has the AspNetCoreModule hosting module installed. If not, click https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/aspnet-core-module? Tabs = aspnetcore2x select the corresponding package for download and installation based on the core version.

Publishing programs and deploying websites are no different from traditional websites.

Set the. net clr version of the application pool to "unmanaged code", because as mentioned earlier, IIS acts as a reverse proxy and does not need to host code.

  

(PS pictures borrow garden Friends pictures and invade and delete them)

Finally, you need to add environment variables to the web. config file.

<EnvironmentVariables> <environmentVariable name = "ASPNETCORE_ENVIRONMENT" value = "Development"/> </environmentVariables>
For more information, see the official document https://docs.microsoft.com/en-us/aspnet/core/publishing/iis

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.