Skip to content

Does Ocelot support IIS virtual directories (load balancing)? #1780

Answered by raman-m
NunoOlliveira asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Nuno!
Your routes definition is incorrect! 
Ocelot does support virtual IIS directories, because virtual directory is a path after the host & port string.

I believe you have to define your routes like this:

{
  "Routes": [
    {
      "UpstreamHttpMethod": [ "Get" ],
      "UpstreamPathTemplate": "/up-path",
      "DownstreamPathTemplate": "/MyVirtualDirectory",
      "DownstreamScheme": "http",
      "DownstreamHostAndPorts": [
        { "Host": "localhost", "Port": 80 }
      ]
    },
    {
      "UpstreamHttpMethod": [ "Get" ],
      "UpstreamPathTemplate": "/up-path1",
      "DownstreamPathTemplate": "/MyVirtualDirectory1",
      "DownstreamScheme": "http",
      "DownstreamHostAnd…

Replies: 6 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@raman-m
Comment options

Answer selected by raman-m
Comment options

You must be logged in to vote
1 reply
@raman-m
Comment options

Comment options

You must be logged in to vote
2 replies
@raman-m
Comment options

@NunoOlliveira
Comment options

Comment options

You must be logged in to vote
3 replies
@raman-m
Comment options

@NunoOlliveira
Comment options

@raman-m
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Initially seen a question could become a new feature or bug or closed ;) IIS Internet Information Services (IIS) for Windows® Server
3 participants
Converted from issue

This discussion was converted from issue #1615 on November 06, 2023 08:33.