Although both Apache and Nginx Rewirte modules are declared based on Perl, the actual use is still different, especially nginx.
In Apache, use global variables%{in the httpd.conf file of the server global configuration ...} The judgment is not secure, and when I use%{request_filename} to determine whether the request is a file, there is an error. Whether the request matches the file or not, it returns No. The reasons for this are indicated in the manual:
If used in per-server context (i.e., before the request was mapped to the filesystem) Script_filename and Request_ FILENAME cannot contain the full local filesystem path since the path was unknown at this stage of processing. Both variables would initially contain the value of Request_uri in this case. In order to obtain the full local filesystem path of the "request in Per-server context", use an url-based look-ahead %{LA-U:REQUEST_FILENAME}
To determine the final value of Request_filename.
It says that, if used in the server configuration environment, the Script_filename and Request_filename variables cannot contain the entire file system path, because these paths are unknown at this processing stage. At this point, these two variables are just the initial values of the Request_uri variable. In order to get the system path, you can use a URL-based variable%{la-u:request_filename} in front of the detection.
Nginx has a very strange phenomenon, in the regular midpoint (.) If there is no regular semantics of the statement in parallel, it is a simple point, if you use \ Escape instead of error, because it is the \. As two characters. For example:
last;
The point number of the replaced part does not need to be escaped. But if this is the case:
last;
Need, do not know other types is this?!
Apache and nginx rewrite rule problems.