Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6015

VPS Ubuntu 22.04 - Django - Gunicorn - Nginx

$
0
0

If I use; gunicorn --bind 0.0.0.0:8000 my_project.wsgi works

Then this is my config:

gunicorn.socket[Unit]Description=gunicorn socket[Socket]ListenStream=/run/gunicorn.sock[Install]WantedBy=sockets.targetgunicorn service[Unit]Description=gunicorn daemonRequires=gunicorn.socketAfter=network.target[Service]User=my_userGroup=www-dataWorkingDirectory=/home/my_user/test EnvironmentFile=/home/my_user/test/.envExecStart=/home/my_user/test/env/bin/gunicorn \--access-logfile - \--workers 3 \--bind unix:/run/gunicorn.sock \my_project.wsgi:application[Install]WantedBy=multi-user.target/etc/nginx/sites-available/testserver {    listen 80;    server_name IP;    location = /favicon.ico { access_log off; log_not_found off; }location /static/ {    root /home/my_user/test;}location / {    include proxy_params;    proxy_pass http://unix:/run/gunicorn.sock;    proxy_set_header Host $host;    proxy_set_header X-Real-IP $remote_addr;    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;    proxy_set_header X-Forwarded-Proto $scheme;}}

Every systemctl status is running but I still show Welcome to Nginx! I want to show my Django App. What can i do?


Viewing all articles
Browse latest Browse all 6015

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>