I have an nginx proxy redirect working inside the docker container to redirect all the requests to the correct service. I have a problem with basic_auth since it does not work as expected. Below is a config for the main server proxy location to point to maildev container.
location /backend_api_v2/swagger.json {
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/conf.d/nginx.htpasswd;
proxy_pass http://${BACKEND_HOST_PORT}/backendAPI/swagger.json;
proxy_redirect default;
}
If the authorization is removed this request does go through and show the swagger definition correctly. What else is interesting is that it is not the nginx that returns 401 but the undertow realm security which even weirder since that endpoint doesn’t require auth.
Here is the headers that get returned.
Any help will be appreciated 07