Question
stuck on 'welcome to nginx' gunicorn django ubuntu 16.04
I am stuck on the ‘welcome to nginx’ page and I need help. Here is what I have and tried.
Test passed:
gunicorn –bind 0.0.0.0:8000 myapp.wsgi:application
/etc/systemd/system/gunicorn.service:
[Unit]
Description=gunicorn daemon
After=network.target
[Service]
User=jarjar
Group=www-data
WorkingDirectory=/home/jarjar/myapp
ExecStart=/home/jarjar/myapp/myappenv/bin/gunicorn --workers 3 --bind unix:/home/jarjar/myapp/myapp.sock myapp.wsgi:application
[Install]
WantedBy=multi-user.target
/etc/nginx/sites-available/myapp:
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name myapp.com www.myapp.com;
return 301 https://$server_name$request_uri;
root /home/jarjar/myapp;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/jarjar/myapp;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/jarjar/myapp/myapp.sock;
}
location ~ /.well-known {
allow all;
}
}
server {
listen 443 ssl http2 default_server ;
listen [::]:443 ssl http2 default_server;
include snippets/ssl-myapp.com.conf;
include snippets/ssl-params.conf;
}
sudo rm /etc/nginx/sites-available/default
sudo systemctl start gunicorn
sudo systemctl enable gunicorn
sudo nginx -t
sudo systemctl restart nginx
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
What does the following command output:
@gndo
total 0
lrwxrwxrwx 1 root root 38 Jul 11 09:26 myapp -> /etc/nginx/sites-available/myapp
Also, my nginx error.log is giving me a
28 [error] 28452#28452: send() failed (111: Connection refused) while resolving, resolver: xx.xx.xxx.xxx:53
@jarjar - I’d double check your URL. That doesn’t look correct
@gndo
I followed this tutorial when I set up my server. He said to put:
@jarjar - OK, I’ve seen the socket surrounded with colons, but maybe the parser allows dropping ending part? From the nginx documentation: