Skip to content

Traefic diverts traffic to internal backend when no trailing slash provided in the url #4804

@gerroon

Description

@gerroon

Did you try using a 1.7.x configuration for the version 2.0?

  • Yes
  • [ x] No

What did you do?

Please see my sample .toml, nothing extra ordinary

What did you expect to see?

I expect that Traefik handles https://MYDOMAIN/app/ same as https://MYDOMAIN/app instead of directing to the local backend

What did you see instead?

https://MYDOMAIN/app/ is forwarded and served properly.

but

https://MYDOMAIN/app becomes http://127.0.0.1:8000/app in the url bar and therefor the page and the server cant be found in the browser.

Output of traefik version: (What version of Traefik are you using?)

Version:      v1.7.10
Codename:     maroilles
Go version:   go1.11.6
Built:        2019-03-29_12:20:34PM
OS/Arch:      linux/amd64

What is your environment & configuration (arguments, toml, provider, platform, ...)?

I am using the native Traefik go binary on Debian Buster x64, against Apache 2.4 that is running on http://127.0.0.1:8000

[global]
  checkNewVersion = false
  sendAnonymousUsage = false

debug = true
logLevel = "DEBUG"

InsecureSkipVerify = true

defaultEntryPoints = ["http", "https"]

[api]
entryPoint = "traefik"
dashboard = true
address = ":8080"

[entryPoints]
  [entryPoints.http]
  address = ":80"
    #[entryPoints.http.redirect]
    entryPoint = "https"

  [entryPoints.https]
  address = ":443"
    [entryPoints.https.tls]

[file]
watch = true

[backends]
  [backends.backend1]
   [backends.backend1.servers]
    [backends.backend1.servers.server0]
    url = "http://127.0.0.1:8000"

[frontends]
  [frontends.frontend1]
   entrypoints = ["http","https"]
   backend = "backend1"
   passHostHeader = true
   #passTLSCert = true

   [frontends.frontend1.routes]
    [frontends.frontend1.routes.route0]
     rule = "Host:MYDOMAIN"

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "MYDOMAIN"
watch = true
exposedbydefault = false


[acme]
email = "EMAIL"
storage = "acme.json"
#caServer = "https://acme-staging-v02.api.letsencrypt.org/directory"
caServer = "https://acme-v02.api.letsencrypt.org/directory"
entryPoint = "https"

[acme.httpChallenge]
entryPoint = "http"

[[acme.domains]]
  main = "MYDOMAIN"

Here is my vhost for :8000

 <VirtualHost *:8000>
  
      ServerAdmin webmaster@localhost
      
   
     BrowserMatch "MSIE [2-6]" \
          nokeepalive ssl-unclean-shutdown \
          downgrade-1.0 force-response-1.0
          BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
  
  
      DocumentRoot /var/www/html
           <Directory />
              Options Includes FollowSymLinks MultiViews
              AllowOverride All 
              Order allow,deny
              allow from all
          </Directory>
  
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
  
  </VirtualHost>


Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions