azure - host multiple public sites on service fabric -


i have service fabric cluster deployed domain of foo.northcentralus.cloudapp.azure.com

it has single node type single public ip address / load balancer.

lets have following 2 apps deployed:

how can set can have multiple domains each hosted on port 80? (assuming own both of these domains obviously)

do need more 1 public ip address in cluster support this?

you should able single public ip address through http.sys magic.

assuming you're using katana web host (the word count , visual object samples reference use katana), should simple starting server using domain name in url:

webapp.start("http://visualobjects.com:80", appbuilder => this.startup.invoke(appbuilder)); 

the underlying windows http server api register server url, , http request comes in host: visualobjects.com header automatically routed server. repeat number of servers own hostname. host routing http.sys multi-website hosting on single machine, same had in iis.

the problem you'll run reserving hostname, have under elevated user account before open server. service fabric has limited support in form of endpoint configuration in servicemanifest.xml:

<!-- won't work registering hostnames --> <resources>   <endpoints>     <endpoint protocol="http" name="serviceendpoint" type="input" port="80" />   </endpoints> </resources> 

the limitation here there specify hostname, service fabric register "http://+:[port]". unfortunately doesn't work if want open server on specific hostname - need register hostname want use. have part manually using netsh (and remove endpoints same port servicemanifest.xml, otherwise override hostname registration).

to register hostname http.sys manually, have run netsh hostname, port, , user account under service runs, default network service:

netsh http add urlacl url=http://visualobjects.com:80/ user="nt authority\network service" 

but have elevated account on each machine service run on. luckily, have service setup entry points can run under elevated account privileges.

edit

one thing need in order work open firewall on same port listening on. can following:

<resources>    <endpoints>       <endpoint protocol="tcp" name="serviceendpoint" type="input" port="80" />    </endpoints> </resources> 

note protocol tcp instead of http. open firewall port not override http.sys registration set .bat script.


Comments