nginx
文章平均质量分 72
justdoshare
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
centos禁止root登录
(2)编辑配置文件 /etc/ssh/sshd_config 修改 PermitRootLogin 后面的 yes 为 no ,并且去掉前面的注释符,同时可以限制失败次数。输入指令 ps -ef |grep 用户名 删掉第一个进程(可能会有其他连号的进程,不需要管),然后在执行 步骤5。(1)先用命令 cat /etc/passwd 查看一下所有的用户 可以看到片你需要删除的用户名。(3)用命令 ps -u 用户名 查看该用户的pid。# 2. 查看每个用户名失败的次数。原创 2023-01-14 11:23:51 · 1793 阅读 · 0 评论 -
wordpress url rewrite nginx配置
server { listen 80; server_name domain.com; charset utf-8; rewrite_log on; //开启rewritelog,配置时测试用 error_log logs/xxxerror.log notice; //开启rewritelog,配置时测试用 #rewrite 静态文件 rewrite ".*\.(html|..原创 2021-05-02 11:33:50 · 446 阅读 · 0 评论 -
Nginx 关于 Rewrite 执行顺序详解
Rewrite( URL 重写)指令可以出现在 server{} 下,也可以出现在 location{} 下,它们之间是有区别的!对于出现在 server{} 下的 rewrite 指令,它的执行会在 location 匹配之前;对于出现在 location{} 下的 rewrite 指令,它的执行当然是在 location 匹配之后,但是由于 rewrite 导致 HTTP 请求的 URI 发生了变化,所以 location{} 下的 rewrite 后的 URI 又需要重新匹配 location ,就好转载 2021-05-01 21:42:23 · 1709 阅读 · 0 评论 -
nginx的location、root、alias指令用法和区别
nginx指定文件路径有两种方式root和alias,指令的使用方法和作用域:[root]语法:root path默认值:root html配置段:http、server、location、if[alias]语法:alias path配置段:locationroot与alias主要区别在于nginx如何解释location后面的uri,这会使两者分别以不同的方式将请求映射到服务器文件上。root的处理结果是:root路径+location路径alias的处理结果是:使用alias路径替转载 2021-05-01 10:07:01 · 226 阅读 · 0 评论 -
nginx location 一些尝试
1. 匹配到目录,会再一次转发进行location匹配 server { listen 80; server_name 192.168.3.112; #规则1 location = / { root html1; index index.htm; expires 40s; } 规则2 location / {原创 2021-03-13 20:16:28 · 414 阅读 · 0 评论 -
nginx location 执行规则
网上很多教程都是错的,这里参考官方文档,整理了一下.整理文档时nginx版本为nginx-1.18.0,后序新版本可以参考新的官方文档,一般不会大变官方文档:http://nginx.org/en/docs/http/ngx_http_core_module.html#locationSyntax: location[=|~|~*|^~]uri{ ... }location@name{ ... } Default: — Context: s...原创 2021-03-04 15:10:24 · 258 阅读 · 1 评论 -
nginx FastCGI错误Primary script unknown解决办法
在centos上成功编译安装nginx 1.4、php 5.4并成功启动nginx和php-fpm后,访问php提示"File not found.",同时在错误日志中看到:代码如下:2013/10/22 20:05:49 [error] 12691#0: *6 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 192.168.168.1, se转载 2021-02-26 00:00:19 · 3831 阅读 · 0 评论 -
配置Nginx来支持php
nginx整合php-fpm1. 启动php-fpm:/usr/local/sbin/php-fpm报错[18-May-2016 18:07:58] ERROR: failed to open configuration file '/usr/local/etc/php-fpm.conf': No such file or directory (2)[18-May-2016 18:07:58] ERROR: failed to load configuration file '/us转载 2021-02-25 19:27:53 · 510 阅读 · 0 评论 -
nginx ReWrite语法
Nginx提供的全局变量或自己设置的变量,结合正则表达式和标志位实现url重写以及重定向。rewrite只能放在server{},location{},if{}中,并且只能对域名后边的除去传递的参数外的字符串起作用。Rewrite主要的功能就是实现URL的重写,Nginx的Rewrite规则采用Pcre,perl兼容正则表达式的语法规则匹配,如果需要Nginx的Rewrite功能,在编译Nginx之前,需要编译安装PCRE库。通过Rewrite规则,可以实现规范的URL、根据变量来做URL转转载 2021-02-25 18:07:38 · 279 阅读 · 0 评论 -
nginx Location语法规则
1.1 Location规则语法规则: location [=|~|~*|^~] /uri/ {… }首先匹配 =,其次匹配^~,其次是按文件中顺序的正则匹配,最后是交给 /通用匹配。当有匹配成功时候,停止匹配,按当前匹配规则处理请求。 符号 含义 = = 开头表示精确匹配 ^~ ^~开头表示uri以某个常规字符串开头,理解为匹配 url路径即可。nginx不对url做编码,因此请求为转载 2021-02-25 17:58:36 · 259 阅读 · 0 评论 -
centOS7安装nginx及nginx配置
安装所需插件1、安装gccgcc是linux下的编译器在此不多做解释,感兴趣的小伙伴可以去查一下相关资料,它可以编译C,C++,Ada,Object C和Java等语言命令:查看gcc版本gcc -v一般阿里云的centOS7里面是都有的,没有安装的话会提示命令找不到,安装命令:yum -y install gcc2、pcre、pcre-devel安装pcre是一个perl库,包括perl兼容的正则表达式库,nginx的http模块使用pcre...转载 2021-02-20 21:24:10 · 203 阅读 · 0 评论
分享