0

I am running into an issue where I cannot find the sites-available folder under /etc/nginx/

Install nginx from source.

nginx -v : nginx version: nginx/1.0.14

Folders under /etc/nginx : conf.d fastcgi_params koi-utf koi-win mime.types nginx.conf scgi_params uwsgi_params win-utf

nginx default.conf located under conf.d folder. Rest of the above are all stand alone files.

I want nginx to show my rails app but I cannot find sites-available folder to add that configuration.

3
  • Why don't you simply create one?
    – Dayo
    Mar 15, 2012 at 17:59
  • I can definitely do that but not sure if it would affect the configuration in any way.
    – sunny31
    Mar 15, 2012 at 18:10
  • Please don't add "solved" to your title. Everyone can tell when your question has a selected answer.
    – user1228
    Mar 19, 2012 at 15:10

2 Answers 2

1

"site-available" etc is just a specific configuration arrangement to manage files from Ubuntu and is not part of Nginx.

If you want to use such an arrangement, and not using the Ubuntu package manager to install Nginx, you need to create the folder yourself.

You might have seen examples with this on the web simply because the people writing these use Ubuntu and just assume everybody else is. As said,it makes no difference to Nginx and is just a convenience thing. I.E., a place to put the config files for individual domains. You can call it whatever you want or just dump the individual files in /etc/nginx/ if you want.

I use a completely different folder system for instance and what this happens to be, if any, is of no relevance to the operation of Nginx.

BTW. conf.d is a valid place put individual conf files and is actually the default place for this. Site-available etc type configurations are changing from this.

4
  • Thanks Dayo. I had installed nginx from source and I think that might be a reason for a different folder structure. I ended up installing through a package, sudo aptitude install nginx, I think. As most of the tutorials used the folder structure with sites-available used to store conf files, I wanted to follow that route.
    – sunny31
    Mar 15, 2012 at 21:57
  • You can use that folder structure or any other if you want. Just create the folder as needed. Please accept the answer if the query is now closed.
    – Dayo
    Mar 16, 2012 at 7:53
  • Hi. You need to tick the checkmark next to the answer to accept it and close the query. Cheers
    – Dayo
    Mar 16, 2012 at 8:31
  • @Dayo where is you nginx is installed ? is it in /etc/nginx or /opt/nginx
    – Hunt
    Dec 10, 2012 at 20:10
1

Just add this at the end of your Nginx conf file at /etc/nginx/nginx.conf before the last closing bracket:

   include /etc/nginx/sites-enabled/*;

Create the site-enabled folder and conf files as needed.

Your Answer

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

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