文档详情

Nginx跳转参数与实例(国外英文资料).doc

发布:2017-06-08约1.11万字共26页下载文档
文本预览下载声明
Nginx跳转参数与实例(国外英文资料) Nginx jump parameters and instances /blog/static/1398273312010240454593/ This log is from /blog/static/42930654200992910456569/ The Location grammatical syntax: Location [= | | | ~ ~ * ^ ~] / uri / {... } Location = / { # only matches/queries. [the configuration A] } The location / { # matches any query because all requests are/begin. But regular expression rules and long block rules will be prioritized and query matches. [the configuration B] } The location ^ ~ / images / { # matches any query that is/images/begins and stops the search. Any regular expression will not be tested. [C] the configuration } Location ~ *. (GIF | JPG | jpeg) ${. # no case-insensitive matches any request that has a GIF, JPG, or jpeg ending. However, all/images/directory requests will be used with Configuration C. [the configuration D] } Regular expressions match, among them: * to distinguish case from case * for case-insensitive matches 3. *! ~ and! The ~ * is case-insensitive and case-insensitive File and directory matching: * -f and! -f is used to determine if a file exists * -d and! -d is used to determine if a directory exists * * e! -e is used to determine if a file or directory exists * -x and! -x is used to determine if the file is executable Flag tags are: * last is the equivalent of the [L] mark in Apache * break ends the match and no longer matches the following rule * redirect returns a 302 temporary redirect address bar to display the post-jump address * permanent return 301 permanent redirect address bar will display the post-jump address Some of the available global variables can be used for conditional judgment (for completion) 1. $args 2. $content_length 3. $content_type 4. $document_root 5. $document_uri 6. $host 7. $http_user_agent $http_cookie 8. 9. $limit_rate 10. $request_body_file 11. $request_method 12. $remote_addr 13. $remote_port 14. $remote_user 15. $request_filename 16. $request_uri 17. $query_string 18 $scheme 19. $server_protocol 20 $serve
显示全部
相似文档