nginx里proxy_pass有无/的区别
location /lile {
配置一: proxy_pass http://192.168.0.37/;
配置二: proxy_pass http://192.168.0.37;
}
环境说明:
反向代理服务器:192.168.0.224
真实数据机器:192.168.0.37
worker_processes ; events {
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout ; server {
listen ;
server_name localhost; root /web1 location /lile {
root /data;
index index.html;
}
}
}
mkdir /web1
echo "My location is /web1" > index.html
mkdir -p /data/lile
echo "My location is /data/lile" > index.html
worker_processes ;
events {
worker_connections ;
} http {
include mime.types;
default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; access_log logs/access.log main;
sendfile on;
keepalive_timeout ; server {
listen ;
server_name localhost;
location /lile {
配置一:proxy_pass http://192.168.0.37;
配置二:proxy_pass http://192.168.0.37/
}
}
}


location / {
配置一: proxy_pass http://192.168.0.37/;
配置二: proxy_pass http://192.168.0.37;
}
nginx里proxy_pass有无/的区别的更多相关文章
- 【10】Nginx:后面有无 / 的区别
写在前面的话 在 nginx 中,我们很多时候都有一个疑问,在 proxy_pass 或者 root 或者 location 后面需不需要加上 /,加和不加有啥区别. root / alias 后面 ...
- Nginx里的root/index/alias/proxy_pass的意思
1.[alias] 别名配置,用于访问文件系统,在匹配到location配置的URL路径后,指向[alias]配置的路径.如: location /test/ { alias /home/sftp/i ...
- Nginx配置proxy_pass
nginx配置proxy_pass,需要注意转发的路径配置 1.location /test/ { proxy_pass http://t6:8300; } 2.location /test/ { p ...
- nginx 之 proxy_pass
nginx中有两个模块都有proxy_pass指令 ngx_http_proxy_module的proxy_pass 语法: proxy_pass URL; 场景: location, if in l ...
- Nginx的proxy_pass及upstream的小型负载均衡
proxy_pass Nginx的proxy_pass将请求代理到其他的后端服务器.例如 listen 9999; server_name wyc.com; location /test/aaa { ...
- nginx中proxy_pass小斜杠
nginx中proxy_pass小斜杠 1. 故事背景 相信做微信公众号开发的朋友都知道,要想在微信中预览效果,必须使用域名访问.很多朋友使用内网穿透工具.不仅不好用还不稳定.所以,发挥脸厚吃天下的态 ...
- 记录一次 Nginx 配置 proxy_pass 后 返回404问题
一. Nginx 配置 proxy_pass 后 返回404问题 故障解决和定位 1.1. 问题 在一次生产涉及多次转发的配置中, 需求是下面的图: 在配置好了 proxy_pass 之后,请求 ww ...
- Nginx配置proxy_pass转发的/路径问题
Nginx配置proxy_pass转发的/路径问题 在nginx中配置proxy_pass时,如果是按照^~匹配路径时,要注意proxy_pass后的url最后的/,当加上了/,相当于是绝对根路径,则 ...
- nginx 配置proxy_pass URL末尾加与不加/(斜线)的区别
nginx在配置proxy_pass的时候 URL结尾加斜线(/)与不加的区别和注意事项 假设访问路径的 /pss/bill.html 加/斜线的情况 location /pss/ { proxy_p ...
随机推荐
- Index.get_indexer 方法的含义
表示,to_match 中的字符,在 unoque_vals 中的位置索引
- TCP/IP三次握手和四次挥手
原博链接:https://www.cnblogs.com/Andya/p/7272462.html
- JxBrowser之五:清除cache和cookie以及SSL证书处理
1.清除cache和cookie //清除cache browser.getCacheStorage().clearCache(); browser.getLocalWebStorage().clea ...
- VS 2017常用快捷键
VS 2017常用快捷键 1.查找和替换 1)查找:使用组合键“Ctrl+F”: 2)替换:使用组合键“Ctrl+H”. (批量更改函数名的神器!) 2.复制/剪切/删除整行代码 1)如果你想复制一整 ...
- VS2015在win10上编译的程序不能在Win7上运行的原因
研究了下,搞懂原理了.是VS 2015 编译的问题,因为我是Win 10 ,所以会用到win 10 的SDK ,这个SDK 依赖了Universal C Runtime ,就是API-MS-CRT-X ...
- webstorm keys
{"licenseId":"ThisCrackLicenseId","licenseeName":"xuza",&quo ...
- Module(模块)
1.每个Angular至少有一个根Module 2.Module时一个带有@NgModule装饰符的类 3.最简单的Module import { NgModule } from '@angular/ ...
- UVa LA 4254 - Processor 二分,贪心 难度: 1
题目 https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_pr ...
- 多任务Forth系统内存布局
body, table{font-family: 微软雅黑} table{border-collapse: collapse; border: solid gray; border-width: 2p ...
- java 打包 war包
接下来,执行jar命令,格式为: jar cvf cmd.war . 打包文件名称 要打包的目录 打包文件保存路径 解压: jar xvf cmd.war