0

Is it ok to create many .conf files under conf.d directory, with each .conf file having unique server name.

for example cd $NGINX_HOME/conf.d

files under the directory are test.conf, test2.conf

test.conf

server { server_name tst1 location / { ... }

}

test2.conf

server { server_name tst2 location /{ ... } }

1 Answer 1

2

I would look at /etc/nginx/nginx.conf for include statements. If you see include /etc/nginx/conf.d/*.conf; then it should work.

Another convention is to put them in /etc/nginx/sites-available/ named by the sites' domain names. Then add symlinks to each of them in /etc/nginx/sites-enabled/. If you try this, make sure you have include /etc/nginx/sites-enabled/* in your /etc/nginx/nginx.conf.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.