# Call back: 404 error page not found

**URL:** <https://community.traefik.io/t/call-back-404-error-page-not-found/19568>\
**Category:** Traefik v2\
**Tags:** tcp\
**Created:** [August 20, 2023, 9:57pm UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568 "2023-08-20T21:57:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![frankenzy](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@frankenzy](https://community.traefik.io/u/frankenzy)\
**Post date:** [August 20, 2023, 9:57pm UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/1 "2023-08-20T21:57:08Z")

</div>

Hi all I am new to the field of reverse proxy & load balancer I follow the installation guide of the documentation  
my config.toml:

```auto
[accesslog]
[api]
    insecure = true
    dashboard = true
    debug = true
[log]
    level = "INFO"

[entryPoints]
    [entryPoints.web]
        address = ":80"

    [entryPoints.nsia]
        address = "127.0.0.2:5000"
    [entryPoints.nsia.http]
    [entryPoints.nsia.http.redirections]
    [entryPoints.nsia.http.redirections.entryPoint]
        to = "websecure"
        scheme = "https"
        permanent = true
        priority = 10

    [entryPoints.websecure]
    address = ":443"

[providers.file]
    directory = "services/"
    watch = true

```

and this is my  
traefik.toml file (is in service folder)

```auto
[http]
    [http.routers]
        [http.routers.traefik_route]
            entryPoints = ["nsia"]
            rule = "Host(`localhost`) && Path(`/api/*`)"
            middlewares = ["api-forwarding"]
            service = "traefik"

    [http.middlewares]
        [http.middlewares.api-forwarding.headers.customRequestHeaders]
            X-Forwarded-Host = "api.publicapis.org"
            X-Forwarded-Proto = "https"
            X-Forwarded-Port = "443"
            X-Forwarded-Uri = "/entries"

    [http.services]
        [http.services.traefik]
            [http.services.traefik.loadBalancer]
                [[http.services.traefik.loadBalancer.servers]]
                    url = "https://api.publicapis.org/entries"

```

But when I call "127.0.0.2:5000"  
I get a 404 page not find error  
Yet if I replace "[https://api.publicapis.org/entries](https://api.publicapis.org/entries)" by local adresse for exemple: "127.0.0.1:8001" server, it goes  
Can anyone help me? It's very urgent!

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [August 21, 2023, 6:44am UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/2 "2023-08-21T06:44:04Z")

</div>

Did you create `127.0.0.2` as IP on your host?

You have a redirect on your port 5000, so I would assume no requests on port 5000 will ever be forwarded.

Note that the forward headers are automatically created by Traefik.

---

<div class="post-metadata">

**Author:** ![frankenzy](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@frankenzy](https://community.traefik.io/u/frankenzy)\
**Post date:** [August 21, 2023, 2:20pm UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/3 "2023-08-21T14:20:30Z")

</div>

Yes to do the test, I created an address: 127.0.0.2:5000, which I tested by pinging; The address successfully answers. My question is do I have to have a particular configuration.? The context of my project is as follows: Our team works in a local network (intranet) and we have to communicate with external partners. we cannot give direct access to our servers, So we want to make rediirection in order to communicate with the web services of the parties on the Internet without going through VPN.

i need help please

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [August 21, 2023, 6:55pm UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/4 "2023-08-21T18:55:20Z")

</div>

Can you provide more details? What is the URL you want to call and what is the URL Traefik should forward the request to? (What do they look like)

---

<div class="post-metadata">

**Author:** ![frankenzy](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@frankenzy](https://community.traefik.io/u/frankenzy)\
**Post date:** [August 22, 2023, 9:27pm UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/5 "2023-08-22T21:27:23Z")

</div>

no problem, The address that Traefik must expose is: 127.10.126.123. The API I need to consume is: [https://api.publicapis.org/entries](https://api.publicapis.org/entries) (an example). So here, when I am on 127.10.126.123, it must automatically redirect me to [https://api.publicapis.org/entries](https://api.publicapis.org/entries). and give me a result. The problem is that currently from I receive 404 page not found. whereas if I type directly www.edan.ci/api in my browser I get feedback.

---

<div class="post-metadata">

**Author:** ![frankenzy](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@frankenzy](https://community.traefik.io/u/frankenzy)\
**Post date:** [August 22, 2023, 9:30pm UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/6 "2023-08-22T21:30:51Z")

</div>

to explain simply. Suppose I have a web service, I want to consume an API through Traefik. My server is: 17.10.116.111 and the API is [https://api.publicapis.org/entries](https://api.publicapis.org/entries). on the web

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [August 23, 2023, 7:24am UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/7 "2023-08-23T07:24:50Z")

</div>

If you locally call an IP (not a domain) with http, then you must set the router rule to it (`Host(`1.2.3.4`)`), so Traefik can match the incoming request and forward it to the according service.

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [August 23, 2023, 6:10pm UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/8 "2023-08-23T18:10:55Z")

</div>

Not sure you need this, it will redirect port 5000 to 443.

> [@frankenzy](#):
>
> ```auto
> [entryPoints.nsia.http]
> [entryPoints.nsia.http.redirections]
> [entryPoints.nsia.http.redirections.entryPoint]
> to = "websecure"
> scheme = "https"
> permanent = true
> priority = 10
> 
> ```

When you want to forward requests addressed to `127.0.0.2:5000` to the external url, then you need a router with `rule = "Host(`127.0.0.2`)"` to match the request.

---

<div class="post-metadata">

**Author:** ![frankenzy](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@frankenzy](https://community.traefik.io/u/frankenzy)\
**Post date:** [August 28, 2023, 3:25am UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/9 "2023-08-28T03:25:39Z")

</div>

hello i come back because i havn't solution:  
but this my new configuration:  
config.toml:  
[accesslog]  
[api]  
insecure = true  
dashboard = true  
debug = true  
[log]  
level = "INFO"

[entryPoints]  
[entryPoints.web]  
address = ":80"

```
[entryPoints.nsia]
    address = "127.0.0.2:5000"
[entryPoints.nsia.http]
[entryPoints.nsia.http.redirections]
[entryPoints.nsia.http.redirections.entryPoint]
    to = "websecure"
    scheme = "https"
    permanent = true
    priority = 10

[entryPoints.websecure]
address = ":443"

```

## [providers.file] directory = "services/" watch = true

traefik.toml (is in server folde: directory = "services/")  
[http]  
[http.routers]  
[http.routers.traefik\_route]  
entryPoints = ["nsia"]  
rule = "Host(`127.0.0.2:5000`) && Path(`/api/*`)"  
middlewares = ["api-forwarding"]  
service = "traefik"

```
[http.middlewares]
    [http.middlewares.api-forwarding.headers.customRequestHeaders]
        X-Forwarded-Host = "api.publicapis.org"
        X-Forwarded-Proto = "https"
        X-Forwarded-Port = "443"
        X-Forwarded-Uri = "/entries"

[http.services]
    [http.services.traefik]
        [http.services.traefik.loadBalancer]
            [[http.services.traefik.loadBalancer.servers]]
                url = "https://api.publicapis.org/entries"
            [[http.services.traefik.loadBalancer.servers]]
                url = "https://api.publicapis.org/entries"

```

* * *

NB: i'm on my local labtop

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [August 28, 2023, 5:44am UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/10 "2023-08-28T05:44:47Z")

</div>

Format your code with 3 backticks in front and after, or select the code and press `</>` .

---

<div class="post-metadata">

**Author:** ![frankenzy](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@frankenzy](https://community.traefik.io/u/frankenzy)\
**Post date:** [August 28, 2023, 8:53am UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/11 "2023-08-28T08:53:21Z")

</div>

config.toml:

```auto
[accesslog]
[api]
insecure = true
dashboard = true
debug = true
[log]
level = "INFO"

[entryPoints]
[entryPoints.web]
address = ":80"

[entryPoints.nsia]
    address = "127.0.0.2:5000"
[entryPoints.nsia.http]
[entryPoints.nsia.http.redirections]
[entryPoints.nsia.http.redirections.entryPoint]
    to = "websecure"
    scheme = "https"
    permanent = true
    priority = 10

[entryPoints.websecure]
address = ":443"

[providers.file]
directory = "services/"
watch = true

```

## 

traefik.toml (is in server folde: directory = "services/")  
[http]  
[http.routers]  
[http.routers.traefik\_route]  
entryPoints = ["nsia"]  
rule = "Host(`127.0.0.2:5000`) && Path(`/api/*`)"  
middlewares = ["api-forwarding"]  
service = "traefik"

```auto
[http.middlewares]
    [http.middlewares.api-forwarding.headers.customRequestHeaders]
        X-Forwarded-Host = "api.publicapis.org"
        X-Forwarded-Proto = "https"
        X-Forwarded-Port = "443"
        X-Forwarded-Uri = "/entries"

[http.services]
    [http.services.traefik]
        [http.services.traefik.loadBalancer]
            [[http.services.traefik.loadBalancer.servers]]
                url = "https://api.publicapis.org/entries"
            [[http.services.traefik.loadBalancer.servers]]
                url = "https://api.publicapis.org/entries"

```

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [August 28, 2023, 9:23am UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/12 "2023-08-28T09:23:53Z")

</div>

`Path()` does exact matching, I don’t think you have a route called `/api/*`. Use `PathPrefix(`/api/`)` instead.

Traefik documentation is your friend. It is a lot, as Traefik has a lot of configuration options, but usually well written and with examples.

---

<div class="post-metadata">

**Author:** ![frankenzy](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@frankenzy](https://community.traefik.io/u/frankenzy)\
**Post date:** [August 31, 2023, 7:12am UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/13 "2023-08-31T07:12:29Z")

</div>

hello ok thank you,  
i come back to you

---

<div class="post-metadata">

**Author:** ![frankenzy](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@frankenzy](https://community.traefik.io/u/frankenzy)\
**Post date:** [October 5, 2023, 4:54pm UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/14 "2023-10-05T16:54:53Z")

</div>

Good morning  
please,  
how can I use traefik to invoke a web application,  
I explain:  
we work mainly on the intranet. To communicate with external partners we use VPNs.  
today we want to use traefik to showcase our services. some of our services must in turn invoke services on the internet such as an Amazon API for example.  
how to proceed. I am new so please explain with a junior level

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [October 5, 2023, 5:50pm UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/15 "2023-10-05T17:50:13Z")

</div>

Traefik is a reverse proxy, it mainly forwards http requests based on Host() and PathPrefix() to a target service/container.

Traefik can forward to any kind of service, it can be external (using dynamic config `loadbalancer.servers.url`, [doc](https://doc.traefik.io/traefik/routing/services/)) as long as domain can be resolved with DNS and IP and port can be reached.

---

<div class="post-metadata">

**Author:** ![frankenzy](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@frankenzy](https://community.traefik.io/u/frankenzy)\
**Post date:** [October 6, 2023, 9:40am UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/16 "2023-10-06T09:40:05Z")

</div>

```auto
yes so far I have no problem with the basic principle, only when I put an external link at the service level
[http]
    [http.routers]
        [http.routers.router_web]
            entryPoints = ["web"]
            rule = "Host(`http://127.0.0.1:7080`)"
            middlewares = ["api-forwarding"]
            service="web"

    [http.services]
        [http.services.web]
            [http.services.web.loadBalancer]
                [[http.services.web.loadBalancer.servers]]
                    url = "http://developer.nytimes.com/livres.pdf/"
                [[http.services.traefik.loadBalancer.servers]]
                    url = "http://developer.nytimes.com/livres.pdf/"

however if I go to the link directly even with pod man I have the ok "200" ok

```

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [October 6, 2023, 11:01am UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/17 "2023-10-06T11:01:24Z")

</div>

This looks wrong: `rule = "Host(`http://127.0.0.1:7080`)"`, protocol and port should not be included. You can try `rule = "Host(`127.0.0.1`)"`.

And if you want to use port 7080, make sure to create an `entrypoint` and open the container port.

---

<div class="post-metadata">

**Author:** ![frankenzy](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@frankenzy](https://community.traefik.io/u/frankenzy)\
**Post date:** [October 6, 2023, 3:27pm UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/18 "2023-10-06T15:27:45Z")

</div>

```auto
Thank you for your help, step by step I am progressing and I understand better and better.
but I receive a 404 error when I test: 127.0.0.1 but it already changes to "https".
here is the complete code:

[http]
    [http.routers]
        [http.routers.traefik]
            entryPoints = ["nsia"]
            rule = "Host(`http://127.0.0.1`)"
            middlewares = ["api-forwarding"]
            service = "traefik"

    [http.middlewares]
        [http.middlewares.api-forwarding.headers.customRequestHeaders]
            X-Forwarded-Host = "https://jsonplaceholder.typicode.com/comments"
            X-Forwarded-Proto = "https"
            X-Forwarded-Port = "443"
            X-Forwarded-Uri = "/entries"

    [http.services]
        [http.services.traefik]
            [http.services.traefik.loadBalancer]
                [[http.services.traefik.loadBalancer.servers]]
                    url = "https://jsonplaceholder.typicode.com/comments"
                [[http.services.traefik.loadBalancer.servers]]
                    url = "https://jsonplaceholder.typicode.com/comments"

what is my mistake and what should I do

```

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [October 6, 2023, 4:18pm UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/19 "2023-10-06T16:18:19Z")

</div>

Again: `Host()` is just using domain or IP. You can not add protocol or port to the parameter, it will not work. [RTFM](https://doc.traefik.io/traefik/routing/routers/#rule)

Check Traefik debug log and access log and Traefik dashboard for errors.

It needs to be the same domain/IP you access with your client/browser. If you request `http://localhost` then it needs to be `Host(`localhost`)`.

---

<div class="post-metadata">

**Author:** ![frankenzy](https://avatars.discourse-cdn.com/v4/letter/f/73ab20/32.png) [@frankenzy](https://community.traefik.io/u/frankenzy)\
**Post date:** [October 7, 2023, 7:51am UTC](https://community.traefik.io/t/call-back-404-error-page-not-found/19568/20 "2023-10-07T07:51:27Z")

</div>

```auto
Thank you for your feedback and sorry for my inattention.
I just corrected. my dashbord works without problem.
but I don't understand why the redirect gives me a 404 error.
is it because I am doing configuration on own machine in localHost (127.0.0.1) or there is another valid reason because for my test url: https://jsonplaceholder.typicode.com/comments,
returns a status 200 ok on postman with json.

code:
[http]
    [http.routers]
        [http.routers.traefik]
            entryPoints = ["nsia"]
            rule = "Host(`127.0.0.1`)"
            middlewares = ["api-forwarding"]
            service = "traefik"

    [http.middlewares]
        [http.middlewares.api-forwarding.headers.customRequestHeaders]
            X-Forwarded-Host = "https://jsonplaceholder.typicode.com/comments"
            X-Forwarded-Proto = "https"
            X-Forwarded-Port = "443"
            X-Forwarded-Uri = "/entries"

    [http.services]
        [http.services.traefik]
            [http.services.traefik.loadBalancer]
                [[http.services.traefik.loadBalancer.servers]]
                    url = "https://jsonplaceholder.typicode.com/comments"
                [[http.services.traefik.loadBalancer.servers]]
                    url = "https://jsonplaceholder.typicode.com/comments"

Need help

```

[Next page](https://community.traefik.io/t/call-back-404-error-page-not-found/19568.md?page=2)
