echo-swagger icon indicating copy to clipboard operation
echo-swagger copied to clipboard

fixed bug with redirect from swagger/ to index.html

Open padremortius opened this issue 1 year ago • 0 comments

Fixed bug with redirect from swagger/ to index.html through proxy with changed prefix

I have:

  • service with swagger http://localhost:8080/service1/swagger/
  • proxy as nginx with configured location /containers/ to my service

Url to swagger through proxy http://localhost:80/containers/service1/swagger/

A call to this URL will be redirected to http://localhost:80/service1/swagger/index.html. We have lost part of the URL

nginx config:

       location /containers/ {
            proxy_pass 		http://localhost:8080/;
            proxy_set_header	X-Real-IP           	$remote_addr;
	    proxy_set_header	X-Forwarded-For     	$proxy_add_x_forwarded_for;
	    proxy_set_header	X-Forwarded-Proto   	http;
	    proxy_set_header	X-Forwarded-Prefix	/containers/;
	    proxy_set_header	X-Forwarded-Port    	80;
	    proxy_set_header	X-Forwarded-Host    	$host;
        }

padremortius avatar May 15 '23 16:05 padremortius