Skip to content

petehouston/nginx-conf-files

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

nginx-conf-files

Some useful nginx config files for sites.

Usage

  1. Copy the appropriate config file and save into nginx site config directory, usually located at /etc/nginx/sites-available, and name it like domain name as a good practice.
  2. Edit the config file to satisfy your requirements, then save.
  3. Symbol link to /etc/nginx/sites-enabled/.
  4. Restart nginx service

Those steps can be illustrated as follow commands:

$ sudo vi /etc/nginx/sites-available/example.com

-- edit file then save

$ sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
$ sudo nginx -t
$ sudo systemctl reload nginx

Config file list

Application Type Download Notes
WordPress Simple Click to Download -
WordPress Advanced Click to Download -
Laravel Simple Click to Download -
Laravel Advanced Click to Download -
Drupal Generic Click to Download applied to Drupal v8+
Symfony Simple Click to Download applied to Symfony v4+. Reference

Leverage Let's Encrypt SSL

Once you add the config to nginx, you can add Let's Encrypt config to site config via certbot.

$ sudo certbot --nginx -d example.com -d www.example.com

All necessary config fields for SSL will be added automatically, so you don't have to do anything at this point.