nginx在配置proxy_pass的时候 URL结尾加斜线(/)与不加的区别和注意事项

假设访问路径的 /pss/bill.html

加/斜线的情况

location /pss/ {
proxy_pass http://127.0.0.1:18081/;
}

被代理的真实访问路径为:http://127.0.0.1:18081/bill.html

 不加/斜线的情况

location /pss/ {
proxy_pass http://127.0.0.1:18081;
}

被代理的真实访问路径为:http://127.0.0.1:18081/pss/bill.html

nginx 配置proxy_pass URL末尾加与不加/(斜线)的区别的更多相关文章

  1. nginx配置proxy_pass URL末尾加与不加/(斜线)的区别

    nginx在配置proxy_pass的时候 URL结尾加斜线(/)与不加的区别和注意事项 假设访问路径的 /pss/bill.html 加/斜线的情况 location /pss/ { proxy_p ...

  2. proxy_pass反向代理配置中url后面加不加/的说明

    在日常的web网站部署中,经常会用到nginx的proxy_pass反向代理,有一个配置需要弄清楚:配置proxy_pass时,当在后面的url加上了/,相当于是绝对根路径,则nginx不会把loca ...

  3. 记录一次 Nginx 配置 proxy_pass 后 返回404问题

    一. Nginx 配置 proxy_pass 后 返回404问题 故障解决和定位 1.1. 问题 在一次生产涉及多次转发的配置中, 需求是下面的图: 在配置好了 proxy_pass 之后,请求 ww ...

  4. Nginx配置proxy_pass

    nginx配置proxy_pass,需要注意转发的路径配置 1.location /test/ { proxy_pass http://t6:8300; } 2.location /test/ { p ...

  5. Nginx配置proxy_pass转发的/路径问题

    Nginx配置proxy_pass转发的/路径问题 在nginx中配置proxy_pass时,如果是按照^~匹配路径时,要注意proxy_pass后的url最后的/,当加上了/,相当于是绝对根路径,则 ...

  6. nginx 配置支持URL HTML5 History 模式 与 设置代理

    拾人牙慧:https://segmentfault.com/q/1010000007140360 nginx 配置支持URL HTML5 History 模式 location / { try_fil ...

  7. Nginx配置proxy_pass【转载】

    在nginx中配置proxy_pass时,当在后面的url加上了/,相当于是绝对根路径,则nginx不会把location中匹配的路径部分代理走;如果没有/,则会把匹配的路径部分也给代理走. 下面四种 ...

  8. Nginx配置proxy_pass转发/路径问题

    proxy_ignore_client_abort on; #不允许代理端主动关闭连接 upstream的负载均衡,四种调度算法 #调度算法1:轮询.每个请求按时间顺序逐一分配到不同的后端服务器,如果 ...

  9. nginx配置 yii2 URL重写规则 SSI配置使shtml

    location / { // 加上红色部分 重写url try_files $uri $uri/ /index.php?$args; if (!-e $request_filename){ rewr ...

随机推荐

  1. [题解]N 皇后问题总结

    N 皇后问题(queen.cpp) [题目描述] 在 N*N 的棋盘上放置 N 个皇后(n<=10)而彼此不受攻击(即在棋盘的任一行,任一列和任一对角线上不能放置 2 个皇后) ,编程求解所有的 ...

  2. 启用k8s metrics server监控

    1.创建aggregator证书 方法一:直接使用二进制源码包安装 $ wget https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 $ chmod +x cfs ...

  3. AngularJS路由变化 监听方法

    #使用AngularJS时,当路由发生改变时,我们需要做某些处理,此时可以监听路由事件,常用的是$routeStartChange, $routeChangeSuccess ##使用场景:在路由配置文 ...

  4. NodeJs操作MongoDB之多表查询($lookup)与常见问题

    NodeJs操作MongoDB之多表查询($lookup)与常见问题 一,方法介绍 aggregate()方法来对数据进行聚合操作.aggregate()方法的语法如下 1 aggregate(ope ...

  5. js 时间格式,加减

    Date.prototype.Format = function (fmt) { //author: rixiao var o = { "M+": this.getMonth() ...

  6. Ffmpeg使用

    ffmpeg官网 刚开始安装的推荐博客|--利用FFmpeg 开发音视频流:一.二.三 1.分辨率码率 主要视频格式与码率: 分辨率 200p——对应的码率是256kpbs,也就是说,一分钟需要流量1 ...

  7. OpenFlow Flow-Mod消息学习

    任务内容 1. 熟悉Flow-Mod消息触发场景. 2. 掌握Flow-Mod消息格式和常用字段含义. 实验原理 OpenFlow 协议支持3种消息类型:Controller-to-Switch(控制 ...

  8. did not finish being created even after we waited 189 seconds or 61 attempts. And its status is downloading

    did not finish being created even after we waited 189 seconds or 61 attempts. And its status is down ...

  9. ubuntu安装nginx pagespeed

    一.自动安装 使用最新稳定版本的ngx_pagespeed自动安装依赖项并构建最新的主线版nginx,请运行: $ sudo bash <(curl -f -L -sS https://ngxp ...

  10. 【linux】常用命令集锦&持续更新...

    滴:转载引用请注明哦[握爪]:https://www.cnblogs.com/zyrb/p/9709013.html  对深度学习训练及日常work中的常用linux命令进行整理. [一]screen ...