By harshku2630
I am using django and gunicorn to run my website I do everything to run my site but when I am going to search my domain name it show me the welcome page of nginx.
This is my harshblog.socket file
[Unit]
Description=gunicorn socket
[Socket]
ListenStream=/run/harshblog.sock
[Install]
WantedBy=sockets.target
This is my harshblog.service file
[Unit]
Description=gunicorn daemon
Requires=harshblog.socket
After=network.target
[Service]
User=harsh
Group=www-data
WorkingDirectory=/home/harsh/harshblog
ExecStart=/home/harsh/harshblog/env/bin/gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/harshblog.sock \
harshbloging.wsgi:application
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
This is my site-enabled file
server {
listen 8000;
server_name www.harshblog.tech;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/harsh/harshblog;
}
location / {
include proxy_params;
proxy_pass http://unix:/run/harshblog.sock;
}
}
I used port 80 also but it can’t solve my problem. So, Please help me I am in trouble.
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 @harshku2630,
First, you need to set the listen directive to port 80 rather than 8000. After that in your server_name directive, add harshblog.tech and www.harshblog.tech not only one of them.
Restart Nginx and see if that would work for you.
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.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.