0

I am trying to configure an IIS hosted DotNet WebAPI with Swaschbuckle behind an Apache Reverse Proxy.

Desired public urls should look something like:

Target urls look like:

Notice that I am trying to remove the /api part. Is there any way I can make Swashbuckle know about this redirection?

sarvasana
  • 642
  • 4
  • 13
  • What does your route config look like in the WebApiConfig.cs file? Once routing is in place, Swashbuckle will pick this up since it uses reflection to find all the routes. – ManOVision Jun 22 '16 at 13:53
  • `config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } );` – sarvasana Jun 23 '16 at 06:08
  • And this is on some of the controller methods `[Route("api/SomeController/SomeMethod")]` – sarvasana Jun 23 '16 at 06:10
  • But the thing is, I want to know if I can configure Swaschbuckle in such a way, that is generates the documentation with URL's such as the ones exposed by the reverse proxy. I do not want to change the routing. – sarvasana Jun 23 '16 at 06:12
  • Did you ever figure out anything around this? I'm coming across a similar issue with a asp.net core 2.1 application. – Eric Nov 29 '18 at 16:20
  • In the end I decided to just remove the /api part from all my routes. – sarvasana Dec 06 '18 at 08:39

0 Answers0