NGINX – example nginx.conf configuration

There are many options and directives that can be used inside nginx.conf. Below is example “starter” configuration that we are using on our newly spawn EC2 instances. We decided to share it as it seems to be working ok on quite few of our servers.

This is example configuration for NginX allowing you to use websites-available  and websites-enabled  directories to manage your websites. It has been created with article NginX – Custom build and installation for AWS EC2 in mind. If you wish you can however use it with custom NginX installation modifying some of those bits adjusting it to your needs.

And here is the content of  nginx.conf file

Note: If you have problems with pasting configuration using vim editor use :set paste” on Vim’s command interface to disable auto-indenting. Now you can paste the block(s) of code. When you done disable the paste mode through the command “:set nopaste

Marek (admin)

Freelance developer, IT enthusiast, blogger with entrepreneurial spirit and passion for making games