Use Subpath for two web applications hosted in one Web Role?

你说的曾经没有我的故事 提交于 2019-12-24 12:37:12

问题


We have two web applications in one Cloud Service, since we want to use the same endpoint for both, we prefer to host these two web applications in one Web Role. This blog figured out it's possible, as long as we add a new site node under Sites.

Our requirement is that we host Web2 in such url: http://appname.cloudapp.net/web2, so if customer click http://appname.cloudapp.net, it will show Web1, and for http://appname.cloudapp.net/web2 it will show web2, use something like subpath to distinguish the two web applciations.

Is it possible?


回答1:


You just need to use a combination of Sites and Virtual applications to achieve that goal.

In your csdef define it as follows:

 <Sites>
     <Site name="Web1" physicalDirectory="Web1">
         <VirtualApplication name="Web2" physicalDirectory="Web2"></VirtualApplication>
    </Site>
 </Sites>

That will result in Web1 being the root application at http://appname.cloudapp.net and Web2 being a virtual directory beneath it.



来源:https://stackoverflow.com/questions/23733640/use-subpath-for-two-web-applications-hosted-in-one-web-role

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!