nginx proxy_pass末尾神奇的/
来源:互联网 发布:淘宝大学免费教程 编辑:程序博客网 时间:2024/04/27 07:24
http://otherserver;和http://otherserver/;有什么区别呢?
location /service/ {
proxy_pass http://otherserver;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
}
location /service/ {
proxy_pass http://otherserver/;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
}
同样访问:http://neverstay.com/service/add.php
前者配置,在后端的机器,收到的是http://neverstay.com/service/add.php
后者配置,在后端的机器,收到的是http://neverstay.com/add.php
如果换成下面这样,会报错:
location ~ ^/(service)/ {
proxy_pass http://otherserver/;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
}
"proxy_pass" may not have URI part in location given by regular expression, or inside named location, or inside the "if" statement, or inside the "limit_except" block in nginx.conf:
但是,这样就没问题了:
location ~ ^/(service)/ {
proxy_pass http://otherserver;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
}
location /service/ {
proxy_pass http://otherserver;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
}
location /service/ {
proxy_pass http://otherserver/;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
}
同样访问:http://neverstay.com/service/add.php
前者配置,在后端的机器,收到的是http://neverstay.com/service/add.php
后者配置,在后端的机器,收到的是http://neverstay.com/add.php
如果换成下面这样,会报错:
location ~ ^/(service)/ {
proxy_pass http://otherserver/;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
}
"proxy_pass" may not have URI part in location given by regular expression, or inside named location, or inside the "if" statement, or inside the "limit_except" block in nginx.conf:
但是,这样就没问题了:
location ~ ^/(service)/ {
proxy_pass http://otherserver;
proxy_next_upstream error timeout invalid_header http_500 http_503 http_404;
}
- nginx proxy_pass末尾神奇的/
- nginx proxy_pass末尾神奇的斜线
- nginx的proxy_pass路径转发规则浅析(末尾/问题)
- nginx proxy_pass 里的”/”
- Nginx的proxy_pass配置
- 转载:nginx proxy_pass 里的”/”
- nginx proxy_pass
- nginx 的proxy_pass 基本设置问题
- nginx 的proxy_pass 基本设置问题
- Nginx配置proxy_pass的/路径问题
- nginx 的proxy_pass 基本设置问题GOOD
- nginx 的proxy_pass 基本设置问题
- nginx rewrite proxy_pass location 的理解
- Nginx配置proxy_pass时的注意事项
- Nginx配置proxy_pass转发的/路径问题
- nginx之proxy_pass的session丢失
- Nginx配置proxy_pass转发的/路径问题
- nginx rewrite proxy_pass location 的理解
- Android 编译源码 错误
- java学习总结(链接)
- SUG 502: Digits Permutation
- linux svn命令
- 常用SQL语句整理(二)
- nginx proxy_pass末尾神奇的/
- 防盗链
- 最短路径 floyd算法
- java对cookie的操作
- KeyguardManager简介
- 《重构》C#版实现(一)构建参考结果的测试用例
- ubuntu 搭建 php 环境
- Mysql 从库跳过
- 2012.7.11总结