Help Center
Where are NGINX logs stored?
NGINX cache is highly recommended to more effectively leverage server resources. It does not negatively impact the functionality of websites, as the .htaccess
file continues to work correctly.
NGINX Logs by Domain
Logs are saved by domain in separate folders. You can find them at the following path:
/var/log/nginx/domains
Viewing Logs
To view the last 100 saved logs of a specific domain, replace "NAME" with the domain name in the following command:
tail -100 /var/log/nginx/domains/NAME
Searching for Specific Logs
You can combine instructions to search for a specific log. For example, to search for access from an IP to a particular domain, use the following command, replacing "SEARCH_CRITERIA" with the desired search term and "NAME" with the domain name:
grep -i SEARCH_CRITERIA /var/log/nginx/domains/NAME
Practical Example
Suppose you want to see the last 100 logs of the domain example.com
and search for accesses from the IP 192.168.1.1
. The commands would be as follows:
View the last 100 logs:
tail -100 /var/log/nginx/domains/example.com
Search for accesses from IP 192.168.1.1
:
grep -i "192.168.1.1" /var/log/nginx/domains/example.com
Implementing NGINX cache and properly managing domain logs are essential practices to improve the performance and management of a web server. By following these steps and using the provided commands, you can optimize the operation of your websites and facilitate the analysis of accesses and errors.
Related articles
- Screen command in CentOs: more efficient sessions
- Solution: 'Service Unavailable' on CloudLinux servers
- Database export via command line
- Protect your data: configure RAID notifications with S.M.A.R.T.
- List CronJobs for all cPanel users
- Delete unnecessary files from the /tmp partition
- Change reserved disk space in CentOS
- Know your hardware: get accurate information on CentOS 7
- Basic SSH commands
- Optimize accounts with manual rearrange
- IP blocking in CSF via command line
- Clear DNS cache: solution to resolution problems
- Change file permissions via command line
- How to open and close ports using CSF in WHM?
- How to Modify the Hosts File in Windows, Linux, and macOS
- How to Use Telnet to Test SMTP Connectivity on Port 25
- Adjusting reserved space on Linux disks
- Adjusting reconstruction speed in RAID on Linux
- Configuring RAID failure notifications with mdadm
- Differences between Legacy VPS and Cloud VPS
- Install cPanel in your server or VPS
- How to send emails via SSH?
- Manage screen session