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 ...
随机推荐
- 714-Card Trick
思维题,把n个卡片倒着放,然后每个卡片循环放到最底下i次,最后出来的结果就是要求的卡牌顺序 #include<stdio.h> #include<string.h> #incl ...
- (16)线程---定时器Timer
# ### 定时器:指定时间执行任务 from threading import Timer def func(): print("目前正在执行任务") t = Timer(5,f ...
- week7 ls
week7 ls 实现ls: 实现ls -l:
- Annotaion——深入理解注解类型
什么是注解? 对于很多初次接触的开发者来说应该都有这个疑问?Annontation是Java5开始引入的新特征,中文名称叫注解.它提供了一种安全的类似注释的机制,用来将任何的信息或元数据(metada ...
- javascript里文字选中/选中文字
一.获取/清除选中的文字 //获取选中的文字 document.getElementById("get").onclick = function () { var txt = wi ...
- postman设置token关联参数,其他接口直接读取token变量
问题描述:有一个登录接口获取token,其他接口再次访问时都要带上token 解决方案: 步骤一:在登录接口访问后设置postman的环境变量,例如设置环境变量名:token,值为登录接口访问成功后, ...
- [hdu P4081] Qin Shi Huang’s National Road System
[hdu P4081] Qin Shi Huang’s National Road System Time Limit: 2000/1000 MS (Java/Others) Memory Li ...
- nginx中try_files
location / { try_files $uri $uri/ /index.php?$query_string; } 当用户请求 http://localhost/example 时,这里的 $ ...
- 201621123075《Java程序设计》第1周学习总结
1.本周学习总结 本周简单了解了一些Java的基本概念,如Java的用途,功能.也学习了一些变量,类型和运算符.我感觉学好Java也是不容易的,尽管它库函数丰富,可最重要的还是那一份创造力. 2.书面 ...
- linux c使用socket进行http 通信,并接收任意大小的http响应(二)
先贴请求头部信息组织代码. 有同学会疑问http_url.h是干什么用的,我要在这里声明,http_url.h并不是给http_url.c用的,实际上http_url.h声明了http_url.c已经 ...