0

i have these rules:

[backends]
  [backends.pma]
    [backends.pma.servers.server1]
    url = "http://phpmyadmin:80"
  [backends.rabbitmq]
    [backends.rabbitmq.servers.server1]
    url = "http://rabbitmq:15672"

[frontends]
  [frontends.pma]
  backend = "pma"
    [frontends.pma.routes.test_1]
    rule = "Host:pma.example.it"
    passHostHeader = true
  [frontends.rabbitmq]
  backend = "rabbitmq"
    [frontends.rabbitmq.routes.test_1]
    rule = "Host:pma.example.it;Path:/rabbitmq"

The host pma.example.it work, i see phpmyadmin, the host pma.example.it/rabbitmq not work, i have {"error":"Object Not Found","reason":"Not Found"}.

But, from traefik container if I type curl http://rabbitmq:15672 it work's. Any ideas?

1
  • I have tried but have 404, I see in Firefox development tools http://pma.example.it/start.js instead of http://pma.example.it/rabbitmq/start.js Commented Feb 4, 2019 at 16:51

4 Answers 4

2

Could you try to use PathPrefix instead of Path as rule.

Note, you have a small typo in your configuration:

[backends]
  [backends.pma] # <---
  [backends.pma.servers.server1]
    url = "http://phpmyadmin:80"

[backends.rabbitmq] # <---
  [backends.rabbitmq.servers.server1]
    url = "http://rabbitmq:15672"

[frontends]
  [frontends.pma]
  backend = "pma"
    [frontends.pma.routes.test_1]
    rule = "Host:pma.example.it"
    passHostHeader = true
  [frontends.rabbitmq]
  backend = "rabbitmq"
    [frontends.rabbitmq.routes.test_1]
    rule = "Host:pma.example.it;Path:/rabbitmq"
Sign up to request clarification or add additional context in comments.

1 Comment

Not work, same error, now i create a new domain for rabbitmq, instead to use a path
1

The path in your two examples aren't equal. When you go to pma.example.it/rabbitmq, your RabbitMQ instance is effectively receiving rabbitmq:15672/rabbitmq, and returning the Object Not Found error.

You probably want PathPrefixStrip instead of Path in your frontend rule. It'll match on paths beginning with /rabbitmq, and strip that before passing it to the backend.

rule = "Host:pma.example.it;PathPrefixStrip:/rabbitmq"

Comments

1

PathPrefixStrip won't work, because the main page of management console loads static files using the stripped url, causing responses with status 404. I had similar problem and fixed it by setting path prefix in rabbitmq.conf. In your case it would be:

management.path_prefix = /rabbitmq

The configuration of Traefik stays unchanged.

See also https://www.rabbitmq.com/management.html#path-prefix

Comments

-3

There is a missing line in backend config

[backends]
   [backends.pma]
   [backends.pma.servers]      # <----------add this
      [backends.pma.servers.server1]
         url = "http://phpmyadmin:80" 

(same for backend.rabbitmq)

1 Comment

this line is not necessary, pma.example.it works, I follow these examples docs.traefik.io/basics

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.