SSI goes to backend
Igor Sysoev
is at rambler-co.ru
Fri Sep 4 16:54:15 MSD 2009
On Fri, Sep 04, 2009 at 03:14:42PM +0300, Marcus Clyne wrote:
> Hi,
> >What if for example you want to ssi from a different domain name so
> >the html is served from http://www.domain.com/ but the ssi uses
> >www.other.com (which is also hosted on the same nginx instance).
> >
> >
> You could set the SSI command to
>
> <!--# include virtual="/domain2/oth-domain-url" -->
>
> Then in your config have
>
> location /domain2/ {
> internal; # if you don't set this location to internal then your
> web server could be used as a public proxy to that domain
> proxy_pass http://domain2.com;
> ...
> }
>
> This would make a sub-request for http://domain2.com/oth-domain-url.
>
> AFAIK you need to set the domain2 statically in your config file, i.e.
> you can't use a regex in the domain name.
No, you may use regex and then resolve a name:
resvoler 127.0.0.1;
location /p/(\w+) {
proxy_pass http://$1;
}
However, here you will lost query string.
--
Igor Sysoev
http://sysoev.ru/en/
More information about the nginx
mailing list