Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Sharing API's between multiple sites in IIS 8.5

Sharing API's between multiple sites in IIS 8.5

Scheduled Pinned Locked Moved ASP.NET
sysadminhelphtmldatabasewindows-admin
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fred2834
    wrote on last edited by
    #1

    Hello, I am trying to share a few API's between multiple sites on the same server (IIS 8.5). In a simple architecture, I would have each site on its own port, and each API on its own port, with the sites pointing to the API's they need. Unfortunately, we have a restriction that forces us to have the actual API's "under" the main site, by using "add application" in IIS, and using aliases for each API. This works fine actually. What I would like to now is to have other sites use the same API's, also by having aliases, but without physically duplicating the API's either on disk, or even in memory. Put simply, it looks like this: localhost:1000/index.html = site1 localhost:1000/aliasAPI1/… = api1 localhost:1000/aliasAPI2/… = api2 … and I would like: localhost:2000/index.html = site2 localhost:2000/aliasAPI1/… = api1 = same as on site 1, in the same physical folder localhost:2000/aliasAPI2/… = api2 = same as on site 1, in the same physical folder The reason being that site 1 is fully intranet, and site 2 will be visible from the outside world via junctions created somewhere else on the network, and where we want to enable only 1 port to reach site 2. I actually made a test simply by adding applications under site 2, and pointing physically to the same API folders, and it works, but it shows that the API's are ran twice in memory. Tried both in the same application pool, and in separate pools. Is there a way to really share the API's in a configuration like this one ? I've Googled the issue.. but couldn't find anything relevant :( Any help would be appreciated :) Fred

    Richard DeemingR 1 Reply Last reply
    0
    • F Fred2834

      Hello, I am trying to share a few API's between multiple sites on the same server (IIS 8.5). In a simple architecture, I would have each site on its own port, and each API on its own port, with the sites pointing to the API's they need. Unfortunately, we have a restriction that forces us to have the actual API's "under" the main site, by using "add application" in IIS, and using aliases for each API. This works fine actually. What I would like to now is to have other sites use the same API's, also by having aliases, but without physically duplicating the API's either on disk, or even in memory. Put simply, it looks like this: localhost:1000/index.html = site1 localhost:1000/aliasAPI1/… = api1 localhost:1000/aliasAPI2/… = api2 … and I would like: localhost:2000/index.html = site2 localhost:2000/aliasAPI1/… = api1 = same as on site 1, in the same physical folder localhost:2000/aliasAPI2/… = api2 = same as on site 1, in the same physical folder The reason being that site 1 is fully intranet, and site 2 will be visible from the outside world via junctions created somewhere else on the network, and where we want to enable only 1 port to reach site 2. I actually made a test simply by adding applications under site 2, and pointing physically to the same API folders, and it works, but it shows that the API's are ran twice in memory. Tried both in the same application pool, and in separate pools. Is there a way to really share the API's in a configuration like this one ? I've Googled the issue.. but couldn't find anything relevant :( Any help would be appreciated :) Fred

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      I suspect you'll need to use the Application Request Routing module to route all API requests to a single application: Using the Application Request Routing Module | Microsoft Docs[^] iis 7.5 - Application Request Routing doesn't route to same machine - Stack Overflow[^] How to configure Application Request Routing in IIS 7.0 for 2 applications running locally on different ports? - Stack Overflow[^]


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      F 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        I suspect you'll need to use the Application Request Routing module to route all API requests to a single application: Using the Application Request Routing Module | Microsoft Docs[^] iis 7.5 - Application Request Routing doesn't route to same machine - Stack Overflow[^] How to configure Application Request Routing in IIS 7.0 for 2 applications running locally on different ports? - Stack Overflow[^]


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        F Offline
        F Offline
        Fred2834
        wrote on last edited by
        #3

        Oh I did not know ARR .. I will look into it deeper, but at first glance it looks like it could solve my problem. Many thanks ! :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups