graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

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

Open atrauzzi opened this issue 1 year ago • 4 comments

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 avatar Sep 05 '24 11:09 atrauzzi

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

loliuy avatar Oct 17 '24 09:10 loliuy

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 avatar Nov 04 '24 09:11 soorajshankar

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

soorajshankar avatar Nov 04 '24 09:11 soorajshankar

Seems to be related to #10136

andoks avatar Jan 28 '25 14:01 andoks