
Nginx proxy_pass
Proxy PassH2
Nginx使用proxy_pass来转发请求
nginx
location /some/path/ {proxy_pass http://www.example.com/link/;}location ~ \.php {proxy_pass http://127.0.0.1:8000;}
需要注意的是,地址后面(http://www.example.com)是否跟随URI是不一样的,()
- 如果有路径,匹配
location的部分会被URI替换掉 - 如果没有路径,则
location的部分不会被替换掉,整个路径都会被转发
Note that in the first example above, the address of the proxied server is followed by a URI, /link/. If the URI is specified along with the address, it replaces the part of the request URI that matches the location parameter. For example, here the request with the /some/path/page.html URI will be proxied to http://www.example.com/link/page.html. If the address is specified without a URI, or it is not possible to determine the part of URI to be replaced, the full request URI is passed (possibly, modified).
评论
新的评论
上一篇
Thymeleaf Layout的共通逻辑
使用Thymeleaf的Layout Dialect时会遇到layout页面本身也有一些动态逻辑的情况。对于Spring MVC的情况,大概有这么几个解决方案。 使用公共的@ModelAttributes方法 把这些layout页面的数据放到@ModelAttributes中,…
下一篇
Mysql联合唯一索引和空值
问题 当Mysql中建立的联合索引, 只要索引中的某一列的值为空时(NULL),即便其他的字段完全相同,也不会引起唯一索引冲突。 原因 Mysql官方文档中有这样的解释 A UNIQUE index creates a constraint such that all valu…
