Had an issue over the last few weeks where some naughty people have been trying to DDOS and scrape Techieshelp. Techieshelp recently moved VPS provider and during this process moved from Apache to NGINX. By default it appears the NGINX does not enable its access logs so I did not have the data required to block the scrapers. People use the access logs to get an idea of the visitors who have been visiting their websites. This is how to enable the Access Logs in NGINX.
The file we need to edit is NGINX.CONF, it is normally located here.
/etc/nginx/
To edit we use the following command:
nano /etc/nginx/nginx.conf
You will presented with a screen similar to below, scroll to the section that says access_log off: and change it to on.
Once done save the file and exit nano, we can stop start or restart NGINX with the following command.
sudo service nginx start sudo service nginx stop sudo service nginx restart
Now your access logs will start to populate, you can view these logs at the following location.
/var/log/nginx/access.log