Newbie question - not working with auth

I have just setup my first Traefik instanced, and is trying to create a HTTTS endpoint, that points to a VM inside my network, with a service running import 80.

I get a 404 page not found, but the url rewrites to /index.php?page=login
even thou the page is blank.

Any good pointer on where to look ?
I can't figure. out, if this is a Traefik error, for a problem with the remote app.

Thanks.

/Robert

Hi @rhjensen79

Not enough information here to work with. Sharing your configuration can really help with pinpointing issues.

Enabling accesslog shows which router is handling a given request which can help identify if a route is or is not handling a request as expected.

What kind of rule are you using?

Thanks. Hope there is. some stupid mistake, somewhere here :slight_smile:

My config file :

http:
  routers:
    phpipam:
      rule: "Host(`cmplab.dk`) && Path(`/phpipam`)"
      service: phpipam
      tls:
        certResolver: myresolver

  services:
    phpipam:
      loadBalancer:
        passHostHeader: true
        servers:
        - url: "http://docker.cmplab.dk:81"
        healthCheck:
          port: 81

Also I enabled access log and it has given me the following.

192.168.50.178 - - [11/Nov/2020:07:07:22 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 1 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:07:22 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 2 "api@internal" "-" 0ms
80.62.116.205 - - [11/Nov/2020:07:07:49 +0000] "GET /phpipam HTTP/2.0" 499 21 "-" "-" 3 "phpipam@file" "http://docker.cmplab.dk:81" 3112ms
80.62.116.205 - - [11/Nov/2020:07:07:53 +0000] "GET /phpipam HTTP/2.0" 499 21 "-" "-" 4 "phpipam@file" "http://docker.cmplab.dk:81" 5550ms
80.62.116.205 - - [11/Nov/2020:07:08:04 +0000] "GET / HTTP/2.0" 404 19 "-" "-" 5 "-" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:08:13 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 8 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:08:13 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 7 "api@internal" "-" 0ms
80.62.116.205 - - [11/Nov/2020:07:08:08 +0000] "GET /phpipam HTTP/2.0" 504 15 "-" "-" 6 "phpipam@file" "http://docker.cmplab.dk:81" 30000ms
192.168.50.178 - - [11/Nov/2020:07:08:39 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 9 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:05 +0000] "GET /phpipam HTTP/2.0" 404 19 "-" "-" 10 "-" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:09 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 11 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:09 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 12 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:14 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 13 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:14 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 14 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:19 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 15 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:19 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 16 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:24 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 17 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:24 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 18 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:29 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 19 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:29 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 20 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:34 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 22 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:34 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 21 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:39 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 23 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:39 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 24 "api@internal" "-" 1ms
192.168.50.178 - - [11/Nov/2020:07:09:44 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 25 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:44 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 26 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:49 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 28 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:49 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 27 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:54 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 30 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:09:54 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 29 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:10:05 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 32 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:10:05 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 31 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:10:19 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 33 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:10:19 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 34 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:10:37 +0000] "GET /api/overview HTTP/1.1" 200 442 "-" "-" 35 "api@internal" "-" 0ms
192.168.50.178 - - [11/Nov/2020:07:10:37 +0000] "GET /api/http/routers?search=&status=&per_page=10&page=1 HTTP/1.1" 200 1533 "-" "-" 36 "api@internal" "-" 0ms

This looks like the browser is closing the connection.

Gateway Timeout.

You might want to double check that the host is connectable from a container on that host.

Path has to match the path exactly for each request to use this router.

As your application is redirecting you to /index.php?page=login subsequent requests would not use your router. Your application likely needs to be reconfigured to run behind a proxy to return the correct paths, if you cannot do this you might only be able to use a plain Host rule. Almost certainly you want to be using PathPrefix and maybe even a stripPrefix middleware.

1 Like