Deploying behind Nginx
See original GitHub issueHi I have an app that runs normally on development server. But on my deployment server, Dockerized and behind an Nginx webserver, it fails to update the plotly graphs (I am guessing this is related to ASGI issues in this setup)
This is the script I use to start gunicorn:
#!/usr/bin/env bash
DEPLOY_HOME="/srv/deploy/myapp"
NUM_WORKERS=4
WSGI_HOST="0.0.0.0"
WSGI_PORT="8000"
ERRLOG="$DEPLOY_HOME/logs/wsgi_server.err"
ACCESS_LOG="$DEPLOY_HOME/logs/wsgi_server.access"
if [ "$DATABASE" = "postgres" ]
then
echo "Waiting for postgres..."
while ! nc -z db 5432 ; do
sleep 0.1
done
echo "PostgreSQL started"
fi
cd $DEPLOY_HOME
#echo "Doing Migrations..."
python3 manage.py makemigrations
python3 manage.py migrate
echo "Collecting Static files..."
chown -R deploy:deploy $DEPLOY_HOME
python3 manage.py collectstatic --noinput
python3 manage.py createsuperuser --noinput --username $DJANGO_SUPERUSER_USERNAME --email $DJANGO_SUPERUSER_EMAIL
exec gunicorn -w $NUM_WORKERS -b $WSGI_HOST:$WSGI_PORT --access-logfile $ACCESS_LOG --error-logfile $ERRLOG myapp.wsgi:application --preload --timeout 480
I think I need to update my nginx.conf but I am not sure how. Do I also need to setup a separate ASGI server process? Like they did here
Any suggestions are welcome.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Deployment Guides | NGINX Plus
Deployment guides for deploying NGINX Plus in cloud environments, global server load balancing, configuring NGINX Plus to load balance or interoperate with ......
Read more >How to deploy web applications using Nginx on Remote ...
We need to follow the given steps in order to deploy web applications using Nginx. Step 1: Open the terminal, and change the...
Read more >How To Deploy a Go Web Application Using Nginx on Ubuntu ...
Step 1 — Building the Go Web Application · Step 2 — Creating a Systemd Unit File · Step 3 — Setting Up...
Read more >How to accelerate web app deployment with Nginx
In order to deploy our application with the Nginx web server, we'll first make a couple of configurations in the /etc/Nginx/Nginx.conf file.
Read more >How to setup an Nginx reverse proxy server example
Nginx reverse proxy configuration steps · Install Nginx on your Windows or Linux server (prerequisite). · Add the Nginx proxy_pass setting in a ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found out that the error I was getting behind NGINX had to do with using
Scattergl
. Once I switched to a regularScatter
plot it all seems to be working.Yes, static files served from the dash app path is tricky. I am having issues loading a logo image but that shouldn’t block the dashboard from functioning.
What I have been able to find upon loading the dashboard page was this error related to plotly’s react code:
Do you think this may have something to do with the version of Plotly I am using?