args and rewrite vars always empty

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


Hello,

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
  }

Request: domain.com/product/android/

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: 1.1.1.1, server: domain.com, request: "GET
/product/android/ HTTP/1.1", host: "domain.com"
2019/05/24 07:51:55 [error] 24217#24217: *560218 open()
"/home/user/domain.com/.txt" failed (2: No such file or directory),
client: 1.1.1.1, server: domain.com, request: "GET /product/android/
HTTP/1.1", host: "domain.com"

Thanks!



More information about the nginx mailing list