New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirect Behavior Unexpected Using Digital Ocean with Caddy #2743
Comments
This is a confirmed behaviour, which is not ideal. We should issue the right redirect irrespective of the trailing slash. |
@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 : apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: ingress
spec:
rules:
- host: example.com
http:
paths:
- path: /custom
backend:
serviceName: hasura
servicePort: 8080
I think it's overall in all cases we want Hasura on someting different from root Here is the error output of Hasura : {
"type": "http-log",
"timestamp": "2020-07-20T21:57:04.445+0000",
"level": "error",
"detail": {
"operation": {
"error": {
"path": "$",
"error": "resource does not exist",
"code": "not-found"
},
"request_id": "a4544567-b2db-4b6f-bc70-82dd1ee7b31d",
"response_size": 65,
"raw_query": ""
},
"http_info": {
"status": 404,
"http_version": "HTTP/1.1",
"url": "/custom",
"ip": "X.X.X.X",
"method": "GET",
"content_encoding": null
}
}
} |
Me too! I'd like to have Hasura live under a different URL path as well. Although, to be honest, I know this is something quite specific and I'd totally understand if this feature is never implemented. Here's my scenario:
The specific scenario above is irrelevant. What matters is that it would be solved by having a server flag that tells Hasura under which url path it is being served. Anyway, the solution specific to AWS API Gateway is to use route type |
I would like to know if there any solutions to this? |
@kevinmarrec did you figure anything out to get this working? please guide 😄 |
Dunno about caddy but in nginx ingress we have to use regex for path re-writes sample yaml apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: testops
labels:
name: testops
annotations:
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: "/$1"
kubernetes.io/ingress.class: "nginx"
spec:
rules:
- host: testops.com
http:
paths:
- pathType: Prefix
path: /address/(.+)
backend:
service:
name: graphql-engine
port:
number: 9000 |
Description
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
Result
{"path":"$","error":"resource does not exist","code":"not-found"}
After talking in the chat, all you have to do is add without
/api
afterwebsocket
leaving you this:This should give you access to the console at
my-domain.com/api/console
. However, if you go tomy-domain.com/api
, it redirects you tomy-domain.com/console
. If you add a trailing slash (my-domain.com/api
), it redirects as expected.The text was updated successfully, but these errors were encountered: