0

I've just hit something strange and can't explain or even reproduce on other server - embedded variable $arg_timestamp missing for some reason.

Server config:

server {
  server_name _;
  listen 80;

  location /{
    add_header X-foo $args;
    add_header X-bar $arg_timestamp;
    add_header X-bar $arg_timestam;
    return 204;
  }
}

and some tests

ogryzek% curl -D - -s 'http://fqdn/?timestamp=3' 
HTTP/1.1 204 No Content
Server: nginx/1.6.2
Date: Sun, 21 May 2017 22:47:34 GMT
Connection: keep-alive
Keep-Alive: timeout=20
X-foo: timestamp=3

ogryzek% curl -D - -s 'http://fqdn/?timestam=3'
HTTP/1.1 204 No Content
Server: nginx/1.6.2
Date: Sun, 21 May 2017 22:47:56 GMT
Connection: keep-alive
Keep-Alive: timeout=20
X-foo: timestam=3
X-bar: 3
  • The Nginx change log doesn't list any Nginx 1.6 versions. If there was a 1.6 it would be three years old. Can you try updating to 1.13? – Tim May 21 '17 at 23:30
  • Yes I can, but this is the newest nginx in Jessie and such behavior is uncommon even for that version. I have bunch of servers with that system/nginx and only one have problem. Of course the configurations have been compare. – Scypi May 22 '17 at 14:26
0

I have found cause of the problem - if is evil

One of other vhost have

if ($args ~* "(.*)timestamp=([0-9]{7})([0-9]{3})($|\&.*)" ) {
  set $arg_timestamp $2000;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.