cancel
Showing results for 
Search instead for 
Did you mean: 

Swagger behind Nginx instead of Zuul

SOLVED
New Contributor

Swagger behind Nginx instead of Zuul

How does Zuul make it swagger on http://foo-service:8080 works correctly for external access from http://public.com/foo-service ?

 

I have a task to replace Zuul with nginx (It's not my decision, I can't change it). I rewrite in nginx http://public.com/foo-service/names-controller/swagger-ui.html to http://foo-service:8080/names-controller/swagger-ui.html , but in swagger response I get broken links - without /foo-service/ that is I get http://public.com/names-controller... instead of http://public.com/foo-service/names-controller/.... With Zuul it was working fine out of the box - magic.

 

Is there any http request header Zuul is setting that is used by swagger?

How does Zuul make it Swagger works fine?

How could it be done in Nginx?

Tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Contributor

Re: Swagger behind Nginx instead of Zuul

Hip Hip ...

proxy_set_header X-Forwarded-Prefix /foo-service/;

helps.

View solution in original post

1 REPLY 1
Highlighted
New Contributor

Re: Swagger behind Nginx instead of Zuul

Hip Hip ...

proxy_set_header X-Forwarded-Prefix /foo-service/;

helps.

View solution in original post

New Here?
Join us and watch the welcome video:
Top Kudoed Authors