Welcome! Log In Create A New Profile

Advanced

how to force nginx do return 204 and log it into access log?

April 27, 2010 08:52PM
Hi,

I'm trying to implement logic which apache making return status 204 instead of 200 and log it into access log.
It doing "RedirectMatch 204 xxxxx.gif$"
for nginx I have created this part of config which working very close to above:
[code]
if ( $request_uri ~ xxxxx.gif ) {
return 204;
}
location ~ xxxx.gif {
log_format special-v4 "$msec\t$args\t$http_cookie";
access_log /path/to/access.log special-v4;
empty_gif;
internal;
}
[/code]

so it works but not writing into log.

[code]
Next one writing into log but not giving response 204:
location ~ xxxx.gif {
log_format special-v4 "$msec\t$args\t$http_cookie";
access_log /path/to/access.log special-v4;
empty_gif;
internal;
return 204;
}
[/code]

My question: is it possible to have ability write access log and have retcode 204 without binary modification custom modules?
Subject Author Posted

how to force nginx do return 204 and log it into access log?

theromis1 April 27, 2010 08:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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