Hi, dash deployment newbie here.
I am trying to deploy a dash app on a virtual LINUX server
PRETTY_NAME=“Debian GNU/Linux 12 (bookworm)”
with dash status
dash 2.17.1
dash-bootstrap-components 1.6.0
dash-core-components 2.0.0
dash-html-components 2.0.0
dash-table 5.0.0
The virtual server (10.20.0.30) has been assigned an external IP address (say A.B.C.D) but no domain name. External requests to port 8050 are open to the virtual server (as is port 80).
I have a NGINX configuration (as below) that does a proxy_pass from port 80 to port 8050 for http requests coming to A.B.C.D. I have no (or very little) control over firewall policy, or server setup (except NGINX configuration)
server {
listen 80;
server_name A.B.C.D;
location / {
include proxy_params;
proxy_buffering off;
proxy_pass http://10.20.0.30:8050;
}
}
So there are three ways to get to my app:
on the local network browse to 10.20.0.30:8050
on the internet browse to A.B.C.D:8050
on the internet browse to A.B.C.D (relying on NGINX)
I have a minimal HelloWorld Flask app:
from flask import Flask
app = Flask(__name__)
@app.route("/")
def helloworld():
print('Inside hello world - all ip adr')
return "Hello World Minimal 0.0.0.0:8050!"
if __name__ == "__main__":
app.run(host='0.0.0.0', port=8050)
All three ways to access the minimal Flask app work as expected
I have a minimal dash app
from dash import Dash, html
app = Dash()
app.layout = html.Div([html.Div(children='Hello World: Minimal dash 8050')])
if __name__ == '__main__':
print('Running minimal dash app on 8050')
app.run(debug=False, port=8050, host='0.0.0.0')
# end if
Of the three ways to get to my app, only the local 10.20.0.30:8050 works as expected.
The other two ways (A.B.C.D and A.B.C.D:8050) just hang (I can see the HTTP request turn up). But if I try to retrieve to JSON layout by A.B.C.D/_dash-layout or A.B.C.D:8050/_dash-layout, the I get back the expected layout .
{“props”:{“children”:[{“props”:{“children”:“Hello World: Minimal dash 8050”},“type”:“Div”,“namespace”:“dash_html_components”}]},“type”:“Div”,“namespace”:“dash_html_components”}
So the network configuration seems OK. Data can flow between my app and the external internet.
I have held off using a WSGI server until I get the simplest setup working.
My setup seems to be unusual in that I have only a raw IP address A.B.C.D, and not a domain name. Can anybody suggest how to instrument / debug dash, to identify why a Flask app works as expected but Dash apps don’t. I don’t think NGINX is at fault, because a direct internet request using the 8050 port fails too (should be independent of NGINX) I’m guessing it might be because when I start the Dash app, it doesn’t know what external IP address (A.B.C.D) it is supposed to be serving as?
Thanks in advance