Nginx not running with no error message -
i trying start nginx server. when type "$> /etc/init.d/nginx start", have message appearing "starting nginx:", , nothing happens. there no error message, , when check status of nginx see not running.
here /etc/nginx/nginx.conf file:
worker_processes 4; daemon off; error_log /home/vincent/tmp/nginx.log; pid /home/vincent/tmp/nginx.pid; events { worker_connections 1024; } http { default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /home/vincent/tmp/access.log main; sendfile on; keepalive_timeout 65; include /etc/nginx/site-enabled/*;
}
and here /etc/nginx/sites-available/default file :
server { listen 80; server_name technical-test.neo9.lan; access_log /var/log/nginx/technical-test.neo9.lan.log main; set $home /home/vincent; location / { alias $home/neo9/web/app/; index index.html; } location /api/ { rewrite ^/api/(.*)$ /$1 break; proxy_pass http://localhost:1234; proxy_set_header host $host; proxy_set_header x-real-ip $remote_addr; } }
first, sudo nginx -t
verify config files good.
i ran same problem. reason had issue twofold. first, had accidentally copied log file site-enabled folder. deleted log file , made sure files in sites-enabled proper nginx site configs. noticed 2 of virtual hosts listening same domain. made sure each of virtual hosts had unique domain names.
sudo service nginx restart
then worked.
Comments
Post a Comment