nginx.conf has a configuration like this
location / {
default_type "application/json;charset=utf-8";
-sharp here must be use rewrite_by_lua instead of content_by_lua
rewrite_by_lua "
-sharp url
"
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://192.168.1.101:8012/;
}
among them, the rewrite operation is done in rewrite_by_lua according to the rules of url.
now you want to add the location, of a web site as follows
location = ~^/admin {
root html;
index index.html index.htm;
}
normally, if you don"t have the location, root loation / of the above rewrite, it will point to the following html page
, but I thought the location of this / admin would take effect. After all, location follows lazy loading. It didn"t actually work.
I don"t know why?