1

I'm having a bit of a problem with nginx while using proxy_pass My infra is as following There is Kubernetes service hosted on AWS and i use ALB ingress controller. there are like 10 application at this moment deployed and running fine on ec2 instance i have installed RabbitMQ that is ONLY available under private subnet. Since i use Datadog to monitor queues and Devs needs to have availability of the portal to check their queues

The point of the problem is as following I`m running with nginx in the middle between ALB Ingress controller and RabbitMQ to expose the management console

All is running fine with my proxy_pass only until i need to access specific queue and thats because the vhost of rabbitmq is "/"

the URL on nginx that is https://DOMAIN:15672/path/#/queues/%2F/DataChanges and this is the configuration under nginx

location /path/{
                proxy_pass http://rabbitmq1.dev.internal:15672/;
        }

Respond for this config is Status Code: 404 Not Found RabbitMQ

i tried different config like suggested on the documentation to use the proxy_pass without a slash at the end but in that case i cannot access the management console and the error is shown as below

location /path/{
                proxy_pass http://rabbitmq1.dev.internal:15672;
        }

Log inside docker for nginx

10.0.25.87 - - [12/Feb/2024:09:46:54 +0000] "GET /l2v/ HTTP/1.1" 404 49 "-"

Browser respond

{"error":"Object Not Found","reason":"Not Found"}

Could you help me out and point me to the potential solution or i should change the nginx to different proxy?

I build the dockerimage simple as following

FROM nginx:latest

COPY default.conf /etc/nginx/conf.d/default.conf

1 Answer 1

0

You could try the following:

Above the proxy pass line in the nginx config, insert this:

    rewrite ^/path(.*)$ $1 break;

It should remove the /path segment of the url which may be confusing the rabbitmq service

Please let me know if this helps

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for sharing this suggestion but its not working here is the respond >10.0.25.87 - [12/Feb/2024:10:37:22 +0000] "GET /l2v/api/exchanges/%2F/Import?msg_rates_age=60&msg_rates_incr=5 HTTP/1.1" 404

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.