ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.38k stars 1.64k forks source link

The swagger not working when hosting gateway in a virtual directory on IIS #1281

Closed jigneshnarain closed 7 months ago

jigneshnarain commented 4 years ago

The swagger endpoint does not update to the virtual hosted gateway. The endpoint remain "/swagger/docs". When clicking on the it open a link to the service swagger without the virtual host name.

Expected /gateway/swagger/docs/v1/servicename Actual /swagger/docs/v1/servicename

However, when I manually navigate to the path /gateway/swagger/docs/v1/servicename, the json renders as expected.

Additionally, I tried the following but no luck. app.UseSwaggerForOcelotUI(opt => { opts.ServerOcelot = "/siteName/gateway" ; })

How do I get swagger to work when hosting the gateway in a virtual directory.

raman-m commented 7 months ago

We don't support Swagger officially❗

But we believe it will be supported in future, see

We don't recommend to deploy to IIS ❕