m1k1o / neko

A self hosted virtual browser that runs in docker and uses WebRTC.
https://neko.m1k1o.net/
Apache License 2.0
6.99k stars 515 forks source link

Running neko with caddy - 404 error #392

Open abhaybhargav opened 4 months ago

abhaybhargav commented 4 months ago

Hi there

I am trying to run neko as another route in my caddy config. I have another route that resolves to the / and the neko is something that I want to get working with the `/browser` route

This is my caddy config. I have followed the instructions from the reverse proxy section in the docs, but to no avail. Can anyone tell me what I am doing wrong here?

{
  "apps": {
    "http": {
      "servers": {
        "srv0": {
          "listen": [":80"],
          "routes": [
            {
              "match": [
                {
                  "host": ["my.host"],
                  "path": ["/browser*"]
                }
              ],
              "handle": [
                {
                  "handler": "reverse_proxy",
                  "upstreams": [
                    {
                      "dial": "127.0.0.1:8080"
                    }
                  ],
                  "headers": {
                    "request": {
                      "set": {
                        "Host": ["{http.request.host}"],
                        "X-Real-IP": ["{http.request.remote.host}"],
                        "X-Forwarded-For": ["{http.request.remote.host}"],
                        "X-Forwarded-Proto": ["{http.request.scheme}"]
                      }
                    }
                  }
                }
              ]
            },
            {
              "match": [
                {
                  "host": ["my.host"]
                }
              ],
              "handle": [
                {
                  "handler": "subroute",
                  "routes": [
                    {
                      "handle": [
                        {
                          "handler": "reverse_proxy",
                          "upstreams": [
                            {
                              "dial": "127.0.0.1:3000"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      }
    }
  }
}