博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
关于 nginx 中 root、alias、proxy_pass 请求的实际路径
阅读量:4297 次
发布时间:2019-05-27

本文共 735 字,大约阅读时间需要 2 分钟。

前言

最近有和 nginx 作斗争,一些掉落如下。

root 与 alias

当如下配置时:

listen 1997;location /img {
root img/sky;}

访问 http://ip:1997/img/morning.jpg,其实访问 http://ip:1997/img/img/sky/morning.jpg

而如下配置时:

listen 1997;location /img {
alias img/sky;}

访问 http://ip:1997/img/morning.jpg,其实访问 http://ip:1997/img/sky/morning.jpg

proxy_pass

当如下配置时:

listen 1997;location /img/sky {
proxy_pass http://ip_another:port_another/static/sky;}

访问 http://ip:1997/img/sky/morning.jpg,其实访问 http://ip_another:port_another/static/sky/img/sky/morning.jpg

当如下配置时:

listen 1997;location /img/sky {
proxy_pass http://ip_another:port_another/static/sky/;}

访问 http://ip:1997/img/sky/morning.jpg,其实访问 http://ip_another:port_another/static/sky/morning.jpg

后语

无。

转载地址:http://kqbws.baihongyu.com/

你可能感兴趣的文章
量化策略回测唐安奇通道
查看>>
CTA策略如何过滤部分震荡行情?
查看>>
量化策略回测DualThrust
查看>>
量化策略回测BoolC
查看>>
量化策略回测DCCV2
查看>>
mongodb查询优化
查看>>
五步git操作搞定Github中fork的项目与原作者同步
查看>>
git 删除远程分支
查看>>
删远端分支报错remote refs do not exist或git: refusing to delete the current branch解决方法
查看>>
python multiprocessing遇到Can’t pickle instancemethod问题
查看>>
APP真机测试及发布
查看>>
iOS学习之 plist文件的读写
查看>>
通知机制 (Notifications)
查看>>
10 Things You Need To Know About Cocoa Auto Layout
查看>>
C指针声明解读之左右法则
查看>>
一个异步网络请求的坑:关于NSURLConnection和NSRunLoopCommonModes
查看>>
iOS 如何放大按钮点击热区
查看>>
ios设备唯一标识获取策略
查看>>
获取推送通知的DeviceToken
查看>>
Could not find a storyboard named 'Main' in bundle NSBundle
查看>>