Hello, can someone tell me where is the location of access.log file? i need to check every page thats been generating by my visitors. can that be done by access.log file? my server is nginx by the way.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
@newbie
The location of your
access.log
file should be defined in your/etc/nginx/nginx.conf
file or your site configuration file within yourserver
block. By default, this would be in/etc/nginx/sites-available
.Look for the
access_log
directive.If it has not been defined, you can define it using the snippet below (for simplicity, this should go in
/etc/nginx/nginx.conf
):… just make sure you change the last line and set
/path/to/access.log
to an actual path.You don’t need to create the
access.log
file, NGINX will do this for you automatically, though the directories in the path must exist, so if the path you choose does not exist, you’ll need to create it before restarting NGINX.After any/all changes to configuration files:
use this command: sudo tail -f /var/log/nginx/error.log
works with sudo nano /var/log/nginx/access.log