How to host multiple .NET Core apps under same url

后端 未结 6 757
南旧
南旧 2020-12-31 07:21

I am building a few web sites in asp.net core (multiple user interface applications and a web api app). They all work together, utilising the web api. For the purpose of m

6条回答
  •  失恋的感觉
    2020-12-31 07:44

    You could use a reverse proxy for serving multiple ASP Net Core application on the same domain.
    Using IIS I'm not quite sure but you need to install URL Rewrite and then follow the documentation provided by Microsoft (also this one should be helpful).
    You can also use nginx using location and proxy_pass as follow:

    ...
    Some nginx Configuration 
    location /App1 {
            proxy_pass http://127.0.0.1:443;
        }
    location /App2 {
            proxy_pass http://127.0.0.1:444;
        }
    location /App3 {
            proxy_pass http://127.0.0.1:445;
        }
    Other configurations...
    

    And then, each time you want add another ASP Net application to your domain you'll need to add another location, run the application on a different point and restart nginx.

提交回复
热议问题