nginx + ssi +远程uri访问不起作用 [英] nginx + ssi + remote uri access does not work

查看:188
本文介绍了nginx + ssi +远程uri访问不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个设置,其中我的nginx位于前面,而apache + PHP位于后面.

I have a setup where my nginx is in front with apache+PHP behind.

我的PHP应用程序在memcache中缓存了一些页面,这些页面可以由nginx直接访问,除了某些动态部分是在Nginx中使用SSI构建的.

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.

我遇到的第一个问题是nginx并没有尝试将内存缓存用于ssi URI.

The first problem I had was nginx didnt try to use memcache for ssi URI.

<!--# include virtual="/myuser" -->

所以我认为,如果我强迫它使用完整的URL,它将做到这一点.

So I figured that if I force it to use a full URL, it would do it.

<!--# include virtual="http://www.example.com/myuser" -->

但是在日志文件(nginx和apache)中,我可以看到在URL的开头添加了斜杠

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"

在SSI模块的源代码中,我看到似乎添加了一个PREFIX,但是我真的可以确定是否可以禁用它.

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.

有人遇到这个问题吗? Nginx版本:在Ubuntu Karmic 64bits上为0.7.62

Anybody got this issue? Nginx version : 0.7.62 on Ubuntu Karmic 64bits

非常感谢

推荐答案

它与nginx无关,您只是做不到. SSI不接受远程uri.您只能指定本地文件路径.

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.

请参阅 http://en.wikipedia.org/wiki/Server_Side_Includes

这篇关于nginx + ssi +远程uri访问不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆