随笔分类 -  nginx

摘要:在 server中加入一下代码 #跨域处理 add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Headers X-Requested-With,Content-Type,language; add_he 阅读全文
posted @ 2022-04-29 11:28 pengcx 阅读(1110) 评论(0) 推荐(1)
摘要:1、查看nginx进程 ps -ef | grep nginx 2、yum erase nginx 3、yum install -y epel-release 4、再次安装 yum install -y nginx 5、nginx -v 6、systemctl enable nginx.servic 阅读全文
posted @ 2022-03-16 15:43 pengcx 阅读(121) 评论(0) 推荐(0)
摘要:location = / { return 404; } 阅读全文
posted @ 2022-03-09 16:59 pengcx 阅读(45) 评论(0) 推荐(0)
摘要:只需在nginx的配置文件中的http配置项中加上 add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Headers X-Requested-With; add_header Access-Contro 阅读全文
posted @ 2022-03-02 09:53 pengcx 阅读(414) 评论(0) 推荐(0)
摘要:例如node的项目,可以在location中做一个验证,然后使用 porxy_pass 反向代理模块实现。 location模块的匹配介绍 1.”=”前缀指令匹配,如果匹配成功,则停止其他匹配。 2.普通字符串指令匹配,顺序是从长到短,匹配成功的location如果使用^~,则停止其他匹配(正则匹配 阅读全文
posted @ 2022-02-24 16:19 pengcx 阅读(1103) 评论(0) 推荐(0)