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

swagger2+nginx reports 404 problem when accessing swagger #4072

Open
aks103204 opened this issue Oct 11, 2023 · 0 comments
Open

swagger2+nginx reports 404 problem when accessing swagger #4072

aks103204 opened this issue Oct 11, 2023 · 0 comments

Comments

@aks103204
Copy link

Hi sir, it works locally(http://localhost:8080/swagger-ui/index.html#/), but not works in server. There are my config

user nginx;
worker_processes auto;

error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;

sendfile        on;

keepalive_timeout  65;

server {
listen 80;
location /swagger/ {
proxy_pass http://172.17.0.3:8080/swagger-ui/index.html;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

}

}
my server ip in the docker container is 172.17.0.3, port 8080. I have set pathMapping to "/swagger" in the SwaggerConfig Could you help me for this, thanks.

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

1 participant