Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger index.html page not accessible through loadbalancer url after deployment #1421

Open
DibyoChatterjee opened this issue Nov 14, 2021 · 1 comment

Comments

@DibyoChatterjee
Copy link

DibyoChatterjee commented Nov 14, 2021

.Net Core 5.0 web api project with Swashbuckle.AspNetCore version 5.6.3.

ISSUE-:
Swagger index.html page or the Swagger json file not accessible after deployment to AWS with a Load balancer url.

STEPS TO REPRODUCE:

I am working in a team in which we have created a solution with multiple Web API projects. Each project has its own startup.cs file & the corresponding swagger configuration details.

Currently we are having two such web api projects -: masterService, userService.

In masterService api project, we have kept the swagger configuration as it is (i.e., in configureServices(), we have services.AddSwaggerGen(...) & in configure(), we have the app.UseSwagger(), app.UseSwaggerUI(options=> options.swaggerEndpoint('/swagger/v1/swagger.json', 'masterservice v1').

Now this Web API is build through Dockerfile & then Jenkins pipeline deploys it to AWS. In AWS we have loadbalancer.

EXPECTED RESULT:

Accessing the /swagger/index.html page using loadbalancer url (i.e, https://loadbalancerurl/swagger/index.html) should show the swagger index.html page with all API endpoints of masterService.

ACTUAL RESULT:

When requested through browser, 404 is returned.

##TRIED:##
I tried to modify the swagger url like /masterService/swagger/index.html (as we have multiple api projects) using routeTemplate(...), then routePefix but no luck. Then I reverted back to the old solution.

##Question:##
What is the issue here? Kindly help.

@dlukyanov
Copy link

for .netcore you need another project: https://github.com/domaindrivendev/Swashbuckle.AspNetCore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants