Welcome! Log In Create A New Profile

Advanced

Re: SSI goes to backend

September 04, 2009 11:26AM
On Fri, Sep 04, 2009 at 05:34:21PM +0300, Marcus Clyne wrote:

> Igor Sysoev wrote:
> >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;
> >}
> >
> I tried that, but am getting the following message in the error log:
>
> 2009/09/04 17:10:10 [error] 18834#0: *1 zero length URI to proxy,
> client: 127.0.0.1, server: localhost, request: "GET /ssi/test.shtml
> HTTP/1.1", subrequest: "/proxy-google/google.com", host: "localhost"

- /proxy-google/google.com
+ /proxy-google/google.com/

> The locations I've tried are:
>
> location ~ /proxy-google/(\w+)
> location ~ /proxy-google/(.+)
>
> with proxy_pass http://$1;
>
> and the error message is the same.
>
> I even tried doing
>
> location ~ /proxy-google/(.+) {
> set $proxy_url $1;
> proxy_pass http://$proxy_url;
> }
>
>
> and that gave the same message.
>
> Doing a statically-defined proxy-pass like above works without the
> resolver directive. I don't have a DNS server running, but I wouldn't
> have thought that I'd need one, would I?
>
> This is true in 0.8.11 and 0.8.13.
>
> Marcus.
>
>

--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

SSI goes to backend

zepolen September 03, 2009 07:18PM

Re: SSI goes to backend

Igor Sysoev September 04, 2009 05:04AM

Re: SSI goes to backend

zepolen September 04, 2009 10:53AM

Re: SSI goes to backend

Igor Sysoev September 04, 2009 10:53AM

Re: SSI goes to backend

Marcus Clyne September 04, 2009 10:53AM

Re: SSI goes to backend

Igor Sysoev September 04, 2009 10:53AM

Re: SSI goes to backend

Marcus Clyne September 04, 2009 11:14AM

Re: SSI goes to backend

Igor Sysoev September 04, 2009 11:26AM

Re: SSI goes to backend

Marcus Clyne September 04, 2009 11:56AM

Re: SSI goes to backend

Igor Sysoev September 04, 2009 12:04PM

Re: SSI goes to backend

Marcus Clyne September 04, 2009 12:22PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 95
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready