In CentOS I installed nginx version 1.6.3 and it came with a default config file that defines a server for port 80. I put my config file in conf.d/ but I couldn't find a way to override the default config other than modifying nginx.conf.

Is there a way to override or disable the default server on port 80 without modifying nginx.conf?


It's possible to define another main config file without modify the original nginx.conf.

/usr/sbin/nginx -t -c /etc/nginx/custom.conf
  • 1
    This would be practically the same as modifying the original config. But thanks, I do this, actually. It just hardly makes sense to me that the default config contains any site setup at all. – allprog Aug 8 '16 at 11:04
  • Yes it could be confusing. Apache Httpd has also a default virtualhost with the message "It works!". – Christophe Morio Aug 9 '16 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.