Jump to content
  • 0
Sign in to follow this  

How to enable nginx site?


I installed Nginx on my Ubuntu server, but not sure how to enable a second config for additional domains. At the moment, only the default config is working. 

Share this post

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 1

After installing Nginx, you should have two directories:

/etc/nginx/sites-enabled and /etc/nginx/sites-available.

Your new configs should be created within 'sites-available'. To activate the Nginx config you will need to that the following command:

ln -s /etc/nginx/sites-available/example.conf /etc/nginx/sites-enabled/

You will need to replace example.conf with your config file name.

After that its adviseble to run nginx -tt this will test the config files to ensure no errors are present that could stop Nginx from restarting.

After the files are linked, run sudo service nginx reload/ service nginx reload orservice nginx restart

Edited by Linus

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this