We are trying to install nginx on a Amazon Linux AMI to config uwsgi and django. But there is no sites-enabled dir under etc/nginx unlike on Ubuntu.
What am I missing here?
We are trying follow instructions from http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html
Use the Sites-Enabled Directory Ubuntu systems have a /etc/nginx/sites-available directory, which contains virtual host (vhost) files for each domain hosted on the Linode. For instance, the domain for example.com typically has a corresponding virtual host file named /etc/nginx/sites-available/www. example.com. conf .
Nginx is a web server and a reverse proxy server for HTTP/HTTPS and more. It is part of LEAP stack. Simply type the following yum command to install it on Amazon Linux AMI: sudo yum search nginx.
Amazon Linux is based on RedHat/CentOS/Fedora so the default installation of nginx doesn't have a sites-avalable or a sites-enabled directory. (As opposed to Debian/Ubuntu) The directory where you usually put your configs is /etc/nginx/conf.d
Having said that, if you really want the sites-available/sites-enabled directories you can just run:
mkdir -p /etc/nginx/sites-enabled
mkdir -p /etc/nginx/sites-available
Then make sure the following is in the http
section of your /etc/nginx/nginx.conf:
include /etc/nginx/sites-enabled/*.conf;
Then if you want to create a specific site configuration you can create your file 'whatever.conf' under /etc/nginx/sites-available . To enable it:
ln -s /etc/nginx/sites-available/whatever.conf /etc/nginx/sites-enabled/whatever.conf
service nginx restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With