args and rewrite vars always empty

User user24 at
Fri May 24 08:27:23 UTC 2019


I'm trying to make simple rewrite to work and found that $args and other
$1 vars from rewrite&try_files are always empty.

nginx version: nginx/1.10.3

Server config:

  location /product/ {
    rewrite ^/product/(.*)/$ /$1.txt last;
   #    try_files $uri/ /test.php?test=$uri; # tries, then server conf
was simplifies and all php environment was switched off for testing


Expected result: "android.txt" file

Real result: read ".txt" file.

Error log with notice:

2019/05/24 07:51:55 [notice] 24217#24217: *560218 rewritten data:
"/.txt", args: "", client:, server:, request: "GET
/product/android/ HTTP/1.1", host: ""
2019/05/24 07:51:55 [error] 24217#24217: *560218 open()
"/home/user/" failed (2: No such file or directory),
client:, server:, request: "GET /product/android/
HTTP/1.1", host: ""


More information about the nginx mailing list