The config looks great. However, a few points:
- If your server responds to both the www and non-www version of the site, just leave a wildcard. So server name should read:
If your server responds to both the www and non-www version of the site, just leave a wildcard. So server name should read:
server_name *.my-site.com;
You shouldn't put your configs in
/etc/nginx/conf.d
. Instead, place them in/etc/nginx/sites-available
and then symlink them (ln -s) to/etc/nginx/sites-enabled
. So, your/etc/nginx
directory should look like:/etc/nginx/ nginx.conf sites-available/ my-site.conf my-other-site.conf yet-another-site.conf sites-enabled/ my-site.conf -> /etc/nginx/sites-available/my-site.conf my-other-site.conf -> /etc/nginx/sites-available/my-other-site.conf yet-another-site.conf -> /etc/nginx/sites-available/yet-another-site.conf
server_name *.my-site.com;
You shouldn't put your configs in
/etc/nginx/conf.d
. Instead, place them in/etc/nginx/sites-available
and then symlink them (ln -s) to/etc/nginx/sites-enabled
. So, your/etc/nginx
directory should look like:/etc/nginx/ nginx.conf sites-available/ my-site.conf my-other-site.conf yet-another-site.conf sites-enabled/ my-site.conf -> /etc/nginx/sites-available/my-site.conf my-other-site.conf -> /etc/nginx/sites-available/my-other-site.conf yet-another-site.conf -> /etc/nginx/sites-available/yet-another-site.conf