Welcome! Log In Create A New Profile

Advanced

Re: Log Of Attempted Files

Maxim Dounin
February 22, 2023 07:34PM
Hello!

On Wed, Feb 22, 2023 at 02:39:36PM -0800, Ivo Welch wrote:

> dear nginx experts --- If I use an alias in my location, then
> $realpath shows in my log file what file was actually served up.
> Great.

There is no $realpath variable in nginx.

The $request_filename variable identifies the file being served
(or going to be served) based on URI and root/alias directives in
effect, see http://nginx.org/r/$request_filename.

> How can I show in the access log file what file(s) nginx tried? I do
> not want the full rewrite engine in the debug log --- it contains way
> too many things I do not understand and way too few things I do [or,
> equivalently, I am just much too clueless]. I would ideally want just
> to see something like
>
> /var/www/html/index.html not found
> /var/www/html/index.htm not found
> /var/www/html/index-debian.htm OK
>
> Short of this, what is the $variable name for the last file for the
> log format in nginx? pointer(s) appreciated.

I don't think it's possible to obtain such a list of files in a
variable.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Log Of Attempted Files

iaw4 February 22, 2023 05:40PM

Re: Log Of Attempted Files

Maxim Dounin February 22, 2023 07:34PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 328
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