Is it possible with nginx?

Igor Sysoev is at rambler-co.ru
Mon Feb 16 14:28:21 MSK 2009


On Mon, Feb 16, 2009 at 10:33:07AM +0100, Peter Vage wrote:

> Igor Sysoev wrote:
> >>   location @fetch {
> >>   internal;
> >>   proxy_pass http://$host_without_files; #!!!! DOESN'T WORK, 502 Bad 
> >> Gateway, if i type here http://web1.http then it works
> > 
> > -   proxy_pass http://$host_without_files;
> > +   proxy_pass http://$host_without_files.http;
> 
> I am very sorry, i did mistake, was very late.
> 
> in my config in proxy_pass was web1.com not web1.http
> 
> proxy_pass http://$host_without_files; #!!!! DOESN'T WORK, 502 Bad 
> Gateway, if i type here http://web1.com then it works

Have you tried

   proxy_pass http://$host_without_files.com$request_uri;

?

> This is my all config which make 502 Bad Gateway
> 
> server {
> listen   80;
>   server_name files.com *.files.com;
>   access_log off;
>   error_log off;
> 
>   if ($host ~* "(.*)\.files\.com" ) {
>   set $host_without_files $1;
>   }
> 
>         location ~* ^.+\.(jpg|jpeg|gif|png) {
>     root /home/www-data/files.com/$host_without_files;
>     access_log off;
>     expires 1d;
>     error_page 404 = @fetch;
>     break;
>         }
> 
>         location @fetch {
>     internal;
>     proxy_pass http://$host_without_files;
>     proxy_store  on;
>     proxy_store_access  user:rw  group:rw  all:r;
>     proxy_temp_path  /home/www-data/temp;
>     root /home/www-data/files.com/$host_without_files;
>         }
> 
>         location / {
>     root   /home/www-data/files.com;
>     index  index.html index.htm;
>         }
>     }
> -- 
> Posted via http://www.ruby-forum.com/.

-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list