# Kong ingress controller 404 when not using /

**URL:** <https://discuss.konghq.com/t/kong-ingress-controller-404-when-not-using/3373>\
**Category:** General\
**Created:** [April 23, 2019, 1:38pm UTC](https://discuss.konghq.com/t/kong-ingress-controller-404-when-not-using/3373 "2019-04-23T13:38:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sartigan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/sartigan/32/1133_2.png) [@Sartigan](https://discuss.konghq.com/u/Sartigan)\
**Post date:** [April 23, 2019, 1:38pm UTC](https://discuss.konghq.com/t/kong-ingress-controller-404-when-not-using/3373/1 "2019-04-23T13:38:39Z")

</div>

Hiya Kong Nation,

Here is a super bizarre problem while using kong ingress controller:

Whenever I specify a path other than simply `/` I get a 404 error:

Here is what I mean:

```auto
spec:
  rules:
  - host: demo.c1.website.com
    http:
      paths:
      - backend:
          serviceName: demo
          servicePort: 80
        path: /
  tls:
  - hosts:
    - demo.c1.website.com
    secretName: website.com

```

I can access my api normally like any ingress controller would let me. { status: 200 }

But if I simply change the path to anything other than / for instance:

```auto
spec:
  rules:
  - host: demo.c1.website.com
    http:
      paths:
      - backend:
          serviceName: demo
          servicePort: 80
        path: /test
  tls:
  - hosts:
    - demo.c1.website.com
    secretName: website.com

```

curling [demo.c1.website.com/test](http://demo.c1.website.com/test) will return:  
`{"status":404,"message":"Not Found"}`

/routes and /services are correctly populated

routes

```auto
{
            "created_at": 1556026481,
            "destinations": null,
            "hosts": [
                "demo.c1.website.com"
            ],
            "id": "18a23f34-45b9-401f-93f9-b9b790fad6b3",
            "methods": null,
            "name": null,
            "paths": [
                "/test"
            ],
            "preserve_host": false,
            "protocols": [
                "http",
                "https"
            ],
            "regex_priority": 0,
            "service": {
                "id": "0cb46894-7acb-4075-b13a-a36b5153a4a0"
            },
            "snis": null,
            "sources": null,
            "strip_path": false,
            "tags": null,
            "updated_at": 1556026481
        }

```

Services:

```auto
{
            "connect_timeout": 60000,
            "created_at": 1555610749,
            "host": "demo.demo.80",
            "id": "0cb46894-7acb-4075-b13a-a36b5153a4a0",
            "name": "demo.demo.80",
            "path": "/",
            "port": 80,
            "protocol": "http",
            "read_timeout": 60000,
            "retries": 5,
            "tags": null,
            "updated_at": 1555610749,
            "write_timeout": 60000
        }

```

upstreams

```auto
{
            "created_at": 1555610749,
            "hash_fallback": "none",
            "hash_fallback_header": null,
            "hash_on": "none",
            "hash_on_cookie": null,
            "hash_on_cookie_path": "/",
            "hash_on_header": null,
            "healthchecks": {
                "active": {
                    "concurrency": 10,
                    "healthy": {
                        "http_statuses": [
                            200,
                            302
                        ],
                        "interval": 0,
                        "successes": 0
                    },
                    "http_path": "/",
                    "https_sni": null,
                    "https_verify_certificate": true,
                    "timeout": 1,
                    "type": "http",
                    "unhealthy": {
                        "http_failures": 0,
                        "http_statuses": [
                            429,
                            404,
                            500,
                            501,
                            502,
                            503,
                            504,
                            505
                        ],
                        "interval": 0,
                        "tcp_failures": 0,
                        "timeouts": 0
                    }
                },
                "passive": {
                    "healthy": {
                        "http_statuses": [
                            200,
                            201,
                            202,
                            203,
                            204,
                            205,
                            206,
                            207,
                            208,
                            226,
                            300,
                            301,
                            302,
                            303,
                            304,
                            305,
                            306,
                            307,
                            308
                        ],
                        "successes": 0
                    },
                    "type": "http",
                    "unhealthy": {
                        "http_failures": 0,
                        "http_statuses": [
                            429,
                            500,
                            503
                        ],
                        "tcp_failures": 0,
                        "timeouts": 0
                    }
                }
            },
            "id": "dd181c04-f078-4084-8f88-00ae3e6de021",
            "name": "demo.demo.80",
            "slots": 10000,
            "tags": null
        }

```

What am I missing?

Thanks,  
Sarti

---

<div class="post-metadata">

**Author:** ![Sartigan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/sartigan/32/1133_2.png) [@Sartigan](https://discuss.konghq.com/u/Sartigan)\
**Post date:** [April 23, 2019, 2:39pm UTC](https://discuss.konghq.com/t/kong-ingress-controller-404-when-not-using/3373/2 "2019-04-23T14:39:50Z")

</div>

I think I see what the problem is.

The ingress path will also go to the same path in my API:

`demo.c1.example.com/test` would redirect to `<api>/test` Since this path does not exist in my api I get a 404 error

The expected behavior would be the root path of my api:  
`demo.c1.example.com/test` --\> `<api>/`

How can I fix this behavior?

Thanks,  
Sarti

---

<div class="post-metadata">

**Author:** ![Sartigan](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/sartigan/32/1133_2.png) [@Sartigan](https://discuss.konghq.com/u/Sartigan)\
**Post date:** [April 23, 2019, 3:51pm UTC](https://discuss.konghq.com/t/kong-ingress-controller-404-when-not-using/3373/3 "2019-04-23T15:51:49Z")

</div>

Creating a KongIngress resource with strip\_path true fixed the problem…

```auto
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
  name: demo
  namespace: demo
route:
  strip_path: true

```

But… is there a way to do this directly in the ingress resource?

Thanks,  
Sarti

---

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [May 1, 2019, 4:40pm UTC](https://discuss.konghq.com/t/kong-ingress-controller-404-when-not-using/3373/4 "2019-05-01T16:40:37Z")

</div>

> [@Sartigan](#):
>
> But… is there a way to do this directly in the ingress resource?

With 0.4.0 version of the Ingress Controller, you `strip_path` will be set to `true` by default and should solve this problem.
