I got my /etc/init.d/nginx
init script from here: https://www.nginx.com/resources/wiki/start/topics/examples/redhatnginxinit/
in my /etc/nginx/nginx.conf
, there's include /etc/nginx/conf.d/*.conf;
which includes the config files of my website.
however, after /etc/init.d/nginx start
, it seems nginx is not loading those config files, and it returns 502 on access.
on the other hand, start nginx with command nginx
works just fine.
what's wrong here?
setenforce 0
and relaunch daemon. If it works - then it's certanly selinux problem. Don't forget to re-enable selinux back! How are you running nginx, "by hand", as a root user? What is user of nginx worker process after you run it? Try launching init file asbash -x /etc/init.d/nginx start
to see debug output.