Skip to content
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

Trying to run Hasura locally with nginx in front of it, getting v1/graphql, console seems busted? #10528

Open
atrauzzi opened this issue Sep 5, 2024 · 3 comments
Labels
k/bug Something isn't working

Comments

@atrauzzi
Copy link

atrauzzi commented Sep 5, 2024

Version Information

Server Version: v2.43.0
Console Asset Version: 1723130278163

Environment

Local on my workstation.

What is the current behaviour?

Trying to run Hasura locally with nginx in front of it, getting requests to v1/graphql in the network console.

What is the expected behaviour?

No bad requests in the network panel.

How to reproduce the issue?

Using some nginx boilerplate I keep around for doing reverse proxy of local services on *.localdev.com. In this case, hasura.localdev.com:

server {
        listen 443 ssl;
        server_name ~^hasura(\..*)\.localdev\.com$;

        location @websocket {
            proxy_pass http://hasura:8078;
        }

        location / {
            proxy_read_timeout 30s;
            proxy_http_version 1.1;
            proxy_redirect off;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host $host;
            proxy_pass http://hasura:8078;
        }
    }

Run the container via podman with standard parameters, make sure it can see postgres, etc...

You'll also need to configure DNS somehow to correctly resolve your workstation (I use dnsmasq as part of NetworkManager on Fedora).

I do this kind of setup so that I can get standard CORS behaviour.

Screenshots or Screencast

image

Keywords

  • /v1/graphql
  • Fedora
  • DNS
  • Local
  • nginx
  • podman
@atrauzzi atrauzzi added the k/bug Something isn't working label Sep 5, 2024
@loliuy
Copy link

loliuy commented Oct 17, 2024

Not only the nginx , when i use docker to deploy , same issue. The apiURL.ts file has the wrong url.

@soorajshankar
Copy link
Member

Hey @atrauzzi, the incorrect URL in the screenshot is from a secondary feature and won't break the console. I see some successful /graphql queries too. Can you clarify the actual UI behavior? Is it showing a full-screen error or just a partial error in the GraphiQL section?

@soorajshankar
Copy link
Member

I just tried with a similar nginx setup, console seem to be loading for me even though the feature graphQL api call is failing (it won't block any primary user actions)
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants