加入收藏 | 设为首页 | 会员中心 | 我要投稿 温州站长网 (https://www.0577zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

[日常] nginx与location规则

发布时间:2021-03-10 12:48:19 所属栏目:Linux 来源:网络整理
导读:=========================================================================2018年3月28日 记录: location = /uri =开头表示精确匹配,只有完全匹配上才能生效。location ^~ /uri ^~ 开头对URL路径进行前缀匹配,并且在正则之前。location ~ pattern ~开

=========================================================================2018年3月28日 记录:

location = /uri    =开头表示精确匹配,只有完全匹配上才能生效。location ^~ /uri   ^~ 开头对URL路径进行前缀匹配,并且在正则之前。location ~ pattern  ~开头表示区分大小写的正则匹配。location ~* pattern  ~*开头表示不区分大小写的正则匹配。location /uri     不带任何修饰符,也表示前缀匹配,但是在正则匹配之后。location /      通用匹配,任何未匹配到其它location的请求都会匹配到,相当于switch中的default。

==================================================================================================2016年8月30日 记录:

linux /var/run/*.pid 文件的作用是记录进程的id号linux下nginx采用epoll的网络I/O模型

location =/ 精确匹配location / 匹配所有请求location /xxx/ 匹配/xxx/的请求location ~ 匹配后面正则表达式,区分大小写location ~* 匹配后面正则表达式,不区分大小写location ^~ 匹配普通字符并终止

在location /里面nginx去除index.php重写 rewrite '^/(.*?)$' /index.php/$1;

nginx反向代理,必须在location /{}里面 proxy_pass http://localhost:5050; proxy_set_header 传递http头

thinkphp nginx fastcgi_split_path_info ^(.+.php)(/.*)$;fastcgi_param PATH_INFO $fastcgi_path_info;

(编辑:温州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读