dagster-io / dagster

An orchestration platform for the development, production, and observation of data assets.
https://dagster.io
Apache License 2.0
11.86k stars 1.49k forks source link

[Content Gap] Document sample reverse proxy config for Dagit webserver #4104

Open dagsterbot[bot] opened 3 years ago

dagsterbot[bot] commented 3 years ago

Dagster Documentation Gap

Document sample reverse proxy config for Dagit webserver

This issue was generated from the slack conversation at: https://dagster.slack.com/archives/C01U954MEER/p1619706927188200?thread_ts=1619706927.188200&cid=C01U954MEER

Conversation excerpt:

U01V61RB41M: Hi I am trying to setup reverse proxy in front of dagit. The page opens but is blank.
UL7C8DRKN: Hey Swadhin, if you open up the JS console do you see any websocket connection errors? 
U01V61RB41M: No, I just see it is trying to load the runs, and there is nothing in systemd log. But when I try with ip and port directly then everything opens.
U01V61RB41M: this is my nginx reverse proxy config
U01V61RB41M: <@UL7C8DRKN> Thanks for the hint. I have updated the config, now it is working fine.
UL7C8DRKN: Awesome! Yup we use websockets for all of the GraphQL requests that Dagit makes. 
UL7C8DRKN: cc <@UDJ0NL1LY> 
UDJ0NL1LY: this is probably a docs hole - we should include a sample reverse proxy config
UDJ0NL1LY: <@UL7C8DRKN> what's the slack shorthand for creating a docs issue
UL7C8DRKN: <@U018K0G2Y85> docs Document sample reverse proxy config for Dagit webserver

Message from the maintainers:

Are you looking for the same documentation content? Give it a :thumbsup:. We factor engagement into prioritization.

yuhan commented 3 years ago

likely belongs to https://docs.dagster.io/concepts/dagit/graphql

afparsons commented 3 years ago

After putting my dagit container behind an nginx reverse proxy, I noticed that the JS console was flooded with errors:

WebSocket connection to 'wss://server.example.com/graphql' failed: DirectGraphQLSubscription.ts:47 

Changing my configuration to the following seems to have alleviated that problem:

location / {
    include proxy_params;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_headers_hash_max_size 1024;
    proxy_headers_hash_bucket_size 128;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_read_timeout 86400;
    proxy_pass http://localhost:3000;
}

Please note that I am an nginx "script-kiddie" and have really no idea what any of these settings do. I simply copied Slack user U01V61RB41M's configuration from their screenshot. But...it works? I think?


Edit: I would also really appreciate documentation on how to place a Dagit behind a subdirectory:

location /dagit/ {
    . . .
    proxy_pass http://localhost:3000/;
}

The above does not work.

dchau-wfr commented 2 years ago

Hi there, I am also getting a blank page using nginx reverse proxy on dagster version 0.14.17. This is what my /etc/nginx/sites-available/default has:

        location /dag {
                include proxy_params;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_headers_hash_max_size 1024;
                proxy_headers_hash_bucket_size 128;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_read_timeout 86400;
                proxy_pass http://localhost:3001;
anthonymejia commented 1 year ago

You need to run dagit with -l /dag

https://docs.dagster.io/_apidocs/cli#cmdoption-dagit-l