nginx +西西+远程uri访问不起作用
我有一个设置,其中我的 nginx 位于前面,apache+PHP 位于后面。
我的 PHP 应用程序在 memcache 中缓存了一些页面,这些页面可以由 nginx 直接访问,除了一些使用 Nginx 中的 SSI 构建的动态部分。
我遇到的第一个问题是 nginx 没有尝试对 ssi URI 使用 memcache。
<!--# include virtual="/myuser" -->
所以我想如果我强制它使用完整的 URL,它就会这样做。
<!--# include virtual="http://www.example.com/myuser" -->
但是在日志文件(nginx 和 apache)中,我可以看到在 url 的开头添加了一个斜杠。
http ssi filter "/http://www.example.com/myuser"
在 SSI 模块的源代码中,我看到似乎添加了一个 PREFIX,但我真的可以判断是否我可以禁用它。
有人遇到这个问题吗? Nginx 版本:Ubuntu Karmic 64 位上的 0.7.62
非常感谢
I have a setup where my nginx is in front with apache+PHP behind.
My PHP application cache some page in memcache which are accessed by nginx directly except some dynamic part which are build using SSI in Nginx.
The first problem I had was nginx didnt try to use memcache for ssi URI.
<!--# include virtual="/myuser" -->
So I figured that if I force it to use a full URL, it would do it.
<!--# include virtual="http://www.example.com/myuser" -->
But in logs file (both nginx and apache) I can see that a slash has been added at the beginning of the url
http ssi filter "/http://www.example.com/myuser"
In the source code of the SSI module I see a PREFIX that seems to be added, but I can really tell if I can disable it.
Anybody got this issue?
Nginx version : 0.7.62 on Ubuntu Karmic 64bits
Thanks a lot
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尽管您无法在 SSI 指令中直接引用它们,但您可以配置 nginx 以包含远程 URL。在站点配置中,使用本地路径创建位置,并指定指向您想要的位置的远程位置。例如:
在提供的 html 中使用引用 /remote 路径的 include 指令:
请注意,您可以自定义使用变量和正则表达式进一步传递的 URL。例如:
You can configure nginx to include remote URLs despite you cannot refer them directly in SSI instructions. In site config create location with local path and named remote location that points where you want to. For example:
and in served html use include directive that refers /remote path:
Note that you may customize URL that is passed further with variables and regexp. For example:
它与 nginx 没有任何关系,你就是不能这样做。 SSI 不接受远程 uri。您只能指定本地文件路径。
看
http://en.wikipedia.org/wiki/Server_Side_Includes
It has nothing about nginx, you just can't do that. SSI doesn't accept remote uri. you can only specify a local file path.
See
http://en.wikipedia.org/wiki/Server_Side_Includes