Serving a dash app using waitress on an actual server running nginx gives me 404 errors

I wanted to ask for help with the problem I posted on stackoverflow and given it is dash related I wanted to try my luck and find someone here that is wiser than me.
The question is here: python - Serving a dash app using waitress on an actual server running nginx gives me 404 errors - Stack Overflow
Thanks a lot.

Hello @gothicVI,

Welcome to the community!

How are you running the server?

Typically, you should run it through gunicorn or uvicorn. You can setup a supervisor to handle the server and make sure it stays up and running. Gunicorn normally runs on :8000.

Hi @jinnyzor thanks for the reply.
What do you mean by how?
I’m running the two examples given on stackoverflow.

So you have links for the two methods you mentioned, e.g., with example usage or documentation?

Sure, uvicorn and gunicorn are pieces of the same puzzle.

Here is what I use to guide through host a flask server on a linux server:

Dash is similar, but has the different that gunicorn will actually need to run the flask server from the dash app.

So, gunicorn -w 3 app:appgunicorn -w app:server and you’ll have to make sure the server is exposed to be picked up.

1 Like

I’ll give that a look for sure.
Is there also an option of running a dash app without flask at all?
That was my initial intent but that didn’t wor as well so I tried wrapping everything in flask which failed again.
So getting rid of an additional dependency that actually is not used would be great :wink:

Dash runs on Flask, unless you don’t use Dash Python.

When Dash starts up, it starts up a flask server, you can expose that server with app.server or you can start it and pass it to dash if you have things that you want to do with it.

I see. The initial version of the app was dash only.
I only wrapped it in flask for testing purposes.

Anyhow, I’ll check the video and be back if further questions arise :slight_smile:

1 Like

Finally found the time to come back to this issue.
I found a solution and posted it as an answer to my initial question on stackoverflow.

Thank’s a ton @jinnyzor, especially for the video. It helped a lot.

1 Like