Welcome! Log In Create A New Profile

Advanced

Re: Force Nginx to log error?

Carl Winbäck
June 20, 2020 04:08AM
On Sun, 14 Jun 2020 at 17:34, Carl Winbäck <c@tunnel53.net> wrote:
> It would be useful to me to be able to trigger such messages, so that
> I can verify that they are sent to the right destination.

I found a simple way to trigger a message to the error log, so I
thought I’d share it in case someone also has use for this.

If the root of your site is /foo/mysite/ create an empty directory
there, e.g. /foo/mysite/xyzzy

Do *not* create any index file there, e.g. no index.html or index.php

Now you request that URL via any client of your choice, e.g. curl:

curl https://mysite.example.com/xyzzy/

That request will trigger a message to the error log that looks like
this:

2020/06/20 07:30:04 [error] 694#694: *835 directory index of
"/foo/mysite/xyzzy/" is forbidden, client: 172.16.3.248, server: ,
request: "GET / HTTP/1.0"


Best regards,
Carl
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Force Nginx to log error?

Carl Winbäck June 14, 2020 08:42AM

Re: Force Nginx to log error?

gariac June 14, 2020 09:54AM

Re: Force Nginx to log error?

Carl Winbäck June 14, 2020 11:36AM

Re: Force Nginx to log error?

Carl Winbäck June 20, 2020 04:08AM

Re: Force Nginx to log error?

gariac June 14, 2020 01:02PM

Re: Force Nginx to log error?

J.R. June 14, 2020 05:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 72
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready