I am developing a django powered application using nginx
and gunicorn
.
Everything was fine, until today which i tried to restart nginx
which failed. so I tested it with sudo nginx -t
command and I got this error.
nginx: [emerg] host not found in "localhost:8004" of the "listen" directive in
/etc/nginx/sites-enabled/808:2
nginx: configuration file /etc/nginx/nginx.conf test failed
this is 808
config file contents:
server {
listen localhost:8004;
error_log /var/www/html/burger808/error.log;
location / {
proxy_pass http://127.0.0.1:8005;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Real-IP $remote_addr;
add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"';
}
location /static/ {
autoindex on;
alias /var/www/html/burger808/burger808/static/;
}
location /media/ {
autoindex on;
alias /var/www/html/burger808/burger808/media/;
}
}
I thought it might be some conflicting over 8004
port. So i checked the other congfig files and there were no conflictings.
I wonder what could've caused this error?