0

I am using NGINX version 1.18.0 as a reverse proxy server.

This is how the config look:

location /test/{
                    proxy_pass http://backend-server.net:7886/;
                      rewrite test/$ /index.htm break;
              }

when test route is requested, NGINX is serving correct resources. My issue is when I look at error log, I am seeing following errors:

2021/02/19 23:03:39 [notice] 8#8: *2 "test/$" matches "/test/", client: 30.647.206.71, server: localhost, request: "GET /test/ HTTP/1.1", host: "testServer.net:9000", referrer: "http://testServer.net:9000/"
2021/02/19 23:03:39 [notice] 8#8: *2 rewritten data: "/index.htm", args: "", client: 30.647.206.71, server: localhost, request: "GET /test/ HTTP/1.1", host: "testServer.net:9000", referrer: "http://testServer.net:9000/"
2021/02/19 23:03:39 [notice] 8#8: *2 "test/$" does not match "/test/formatter.js", client: 30.647.206.71, server: localhost, request: "GET /test/formatter.js HTTP/1.1", host: "testServer.net:9000", referrer: "http://testServer.net:9000/test/"
2021/02/19 23:03:39 [notice] 8#8: *1 "test/$" does not match "/test/lib/helper.js", client: 30.647.206.71, server: localhost, request: "GET /test/lib/helper.js HTTP/1.1", host: "testServer.net:9000", referrer: "http://testServer.net:9000/test/"
2021/02/19 23:03:39 [notice] 8#8: *7 "test/$" does not match "/test/missing.js", client: 30.647.206.71, server: localhost, request: "GET /test/missing.js HTTP/1.1", host: "testServer.net:9000", referrer: "http://testServer.net:9000/test/"
2021/02/19 23:03:39 [notice] 8#8: *6 "test/$" does not match "/test/main.css", client: 30.647.206.71, server: localhost, request: "GET /test/main.css HTTP/1.1", host: "testServer.net:9000", referrer: "http://testServer.net:9000/test/"
2021/02/19 23:03:39 [notice] 8#8: *7 "test/$" does not match "/test/missing.js", client: 30.647.206.71, server: localhost, request: "GET /test/missing.js HTTP/1.1", host: "testServer.net:9000", referrer: "http://testServer.net:9000/test/"

What is the reason for these errors ("test/$" does not match "/test/lib/helper.js")? How can I fix them ?

Below image shows file structure on backend server and how files are served correctly on front end server using proxy pass. enter image description here

OpenStack
  • 5,048
  • 9
  • 34
  • 69
  • 1
    These are not errors. You have [`rewrite_log`](http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite_log) enabled. Every URI that hits the `rewrite` statement generates a log entry whether it matches the regular expression or not. – Richard Smith Feb 20 '21 at 11:42
  • @RichardSmith: This makes sense. Should I be worried about this kinda messages `"test/$" does not match "/test/formatter.js"`? Is there any way to fix it ? Do I need to adapt any best practices as far as URL rewrites are concerned. – OpenStack Feb 20 '21 at 18:42

0 Answers0