Question
Nginx pointing to django project via domain name, but pointing to default nginx page via IP
I have the following in /etc/nginx/sites-available/jobzumo
:
server{
listen 80;
server_name 'jobzumo.com';
location = /favicon.ico { access_log off; log_not_found $
location /static/ {
root /home/justin/project;
}
location / {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}
}
If I visit jobzumo.com, I will see the default django rocket ship and everything is working fine. If I visit my IP I will see the default ‘welcome to nginx’ page. If I change the server_name
to my IP instead of the 'jobzumo.com’ domain name, the opposite will happen(Rocket ship at IP, welcome to nginx at domain). Does anyone know how to get both the IP and domain name to point at my django project?
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.
×