Redirect Behavior Unexpected Using Digital Ocean with Caddy
See original GitHub issueDescription
For my web app, I want to be able to create a reverse proxy and place all of Hasura behind api
instead of the root of my domain (since that’s where my app is served from). When I followed the docs, I couldn’t get it to work from /api
.
Recreation Steps
My Caddy config
my-domain.com {
proxy /api graphql-engine:8080 {
websocket
}
}
Result
{"path":"$","error":"resource does not exist","code":"not-found"}
After talking in the chat, all you have to do is add without /api
after websocket
leaving you this:
my-domain.com {
proxy /api graphql-engine:8080 {
websocket
without /api
}
}
This should give you access to the console at my-domain.com/api/console
. However, if you go to my-domain.com/api
, it redirects you to my-domain.com/console
. If you add a trailing slash (my-domain.com/api
), it redirects as expected.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:6 (1 by maintainers)
Top Results From Across the Web
DigitalOcean is not redirecting website address to the droplet
Everything seems to be working just fine but you are redirecting your http traffic to https and it looks like that you have...
Read more >How to fix Infinite Redirect Loop with WordPress Site ...
Right now i've got a WordPress site living on DigitalOcean by way of RunCloud. DNS is managed by CloudFlare and have an A...
Read more >How To Host a Website with Caddy on Ubuntu 18.04
In this tutorial, you'll build Caddy from source using xcaddy, a custom Caddy builder tool, and use it to host a website secured...
Read more >How To Host a Website with Caddy on Ubuntu 22.04
The tls directive configures Caddy's behavior when using TLS and you order it to use the digitalocean plugin for setting DNS records and ......
Read more >Untitled
Kalmoohi episode 20, Appropriate non-verbal behavior, Mountjoy cemetery ... Niu wrestling room, Redirect asp page using javascript, Pflanzenanatomie.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@marionschleifer Seems the task have been assigned multiple times to someone different but no updates ?
It seems this issue also affect Kubernetes when using an Ingress Controller and specifying we want Hasura on a specific path :
example.com/custom
leads to{"path":"$","error":"resource does not exist","code":"not-found"}
I think it’s overall in all cases we want Hasura on someting different from root
/
, that the issue happens.Here is the error output of Hasura :
Dunno about caddy but in nginx ingress we have to use regex for path re-writes
sample yaml