Welcome! Log In Create A New Profile

Advanced

log/list IP Address accessing folder

Posted by matrixebiz 
log/list IP Address accessing folder
September 28, 2019 11:57AM
Hello, I am using nginx for Windows and is there a log on what IP Address accessed the webserver folder? if not, is there a program that I can use to monitor a folder and tell me the IP Addresses of the computers that accessed the folder?
Thanks
Re: log/list IP Address accessing folder
September 28, 2019 03:53PM
Look in the /log folder.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: log/list IP Address accessing folder
October 25, 2019 08:07AM
There is a /logs folder which only has the files error.log and nginx.pid in it
Re: log/list IP Address accessing folder
October 25, 2019 12:46PM
Got it working. Had to define access_log;

access_log /logs/access.log
Re: log/list IP Address accessing folder
October 25, 2019 10:37PM
How do I correctly set buffer size and file size for the access log in windows?
Re: log/list IP Address accessing folder
October 26, 2019 04:52PM
If you are referring to ' open_log_file_cache',

open_log_file_cache max=1000 inactive=20s valid=1m min_uses=2;

Others,

open_file_cache max=1000 inactive=20s;
open_file_cache_errors on;
open_file_cache_min_uses 3;
open_file_cache_valid 20s;

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: log/list IP Address accessing folder
October 27, 2019 06:15PM
Hi , no, I was referring to the windows nginx.conf setting;

log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $bytes_sent '
'"$http_referer" "$http_user_agent" "$gzip_ratio"';

access_log logs/access.log compression buffer=16k flush=2m;


but I'm not sure if that is correct for what I want. I want to create the access log file which works but after a day the file is 1GB, I just want it to only store the last 5 minutes or so.
Re: log/list IP Address accessing folder
October 28, 2019 04:44AM
Its a flat file which gets appended, there is no size regulation.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: log/list IP Address accessing folder
October 28, 2019 08:21AM
Okay, is there something else I can do to about keeping the log file small?
Re: log/list IP Address accessing folder
October 28, 2019 09:25AM
Rename the logfile and signal nginx to reopen logs (nginx -s reopen) I think, check the options.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: log/list IP Address accessing folder
October 28, 2019 10:58AM
Okay, so what will this do for me? Do I have to run this every hour or something? Thanks
Re: log/list IP Address accessing folder
October 28, 2019 12:13PM
Try it and see, run it once a day and see how big/small the logs are.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: log/list IP Address accessing folder
October 28, 2019 02:29PM
It didn't seem to do anything with the access.log file :(
I can't rename it or delete it ahead of time before doing nginx -s reopen because I get access denied
Re: log/list IP Address accessing folder
October 29, 2019 06:39AM
I do it all the time, rename, reopen and move renamed files, works for all log files.
Look at access rights who does the rename.

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: log/list IP Address accessing folder
October 29, 2019 08:18AM
You do it while nginx is running? if I stop the logging then I can delete it but while nginx in running, it has the file locked.
Re: log/list IP Address accessing folder
October 29, 2019 08:39AM
Yes while its running, locking has no bearing as a FD uses a link not a name while its open.

FOR %%G IN (*.log) DO ren "%%G" "%datename%_%%G"
nginx -s reopen
sleep 5
move /y %datename%_*.* data

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: log/list IP Address accessing folder
October 29, 2019 11:35AM
Hello, this is the massage I get;

C:\nginx>nginxLogReopen.bat

Waiting for 0 seconds, press a key to continue ...
A duplicate file name exists, or the file
cannot be found.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 174
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready