By attam059
this is my gunicorn.service file.
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
User=sammy
Group=www-data
WorkingDirectory=/home/sammy/myprojectdir
ExecStart=/var/www/html/new_remove_bg/newvenv/bin/gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/gunicorn.sock \
/var/www/html/new_remove_bg/mysite/mysite.wsgi:application
[Install]
WantedBy=multi-user.target
ExecStart=/var/www/html/new_remove_bg/newvenv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/var/www/html/new_remove_bg/mysite/mysite.sock myproject.wsgi:application
this is my new_remove_bg file
server {
listen 80;
server_name slicebg.com;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /var/www/html/new_remove_bg/mysite;
}
location / {
include proxy_params;
proxy_pass http://unix:/var/www/html/new_remove_bg/mysite/mysite.sock;
}
}
Please guide me how to overcome this issue and i am trying to deploy django application.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
You would see a 502 error when the backend service is not running.
Is the Gunicorn service running? You can check that with this command:
sudo systemctl status gunicorn
If it is not running make sure that it is started:
sudo systemctl start gunicorn
Also you can enable the service, so that the next time the server reboots, it would start automatically:
sudo systemctl enable gunicorn
Let me know how it goes. Regards, Bobby
I did not, I just used the above commands which you mentioned, after that I faced this error.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.