问题原文
原帖链接 · wong2 · CC BY-SA 3.0
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?
已采纳解答
原帖链接 · Alexander Tolkachev · CC BY-SA 3.0
Looks like your problem with wrong init file. Usually nginx install it from RPM and no additional files required. In your link metioned, that it init file tested on CentOS 5, but you using CentOS 6, where it not tested. Try to remove this init file and reinstall nginx from RPM or repo, it should install good one init file.
If you don't want to do it, you could try to copy init file from there. It's copy of init file from installed on CentOS 6 nginx.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
