11 messages in ru.sysoev.nginxRe: Is it possible with nginx?
FromSent OnAttachments
Peter VageFeb 15, 2009 1:05 pm 
Maxim DouninFeb 15, 2009 1:45 pm 
Peter VageFeb 15, 2009 2:07 pm 
Peter VageFeb 15, 2009 3:41 pm 
Igor SysoevFeb 16, 2009 12:55 am 
Peter VageFeb 16, 2009 1:32 am 
Maxim DouninFeb 16, 2009 2:06 am 
Peter VageFeb 16, 2009 3:04 am 
Igor SysoevFeb 16, 2009 3:27 am 
Peter VageFeb 16, 2009 3:59 am 
Maxim DouninFeb 16, 2009 4:56 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Is it possible with nginx?Actions...
From:Peter Vage (lis@ruby-forum.com)
Date:Feb 16, 2009 3:59:11 am
List:ru.sysoev.nginx

Igor Sysoev wrote:

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

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;

Yes I have website http://web1.com/image.jpg I go to http://web1.com.files.com/image.jpg

I am using if ($host ~* "(.*)\.files\.com" ) { set $host_without_files $1; }

proxy_pass http://web1.com; #works, cache file is under /web1.com/image.jpg proxy_pass http://host_without_files; # not work, 502 Bad Gateway proxy_pass http://host_without_files$request_uri; # not work, 502 Bad Gateway proxy_pass http://host_without_files.com$request_uri; # not work, 502 Bad Gateway, why .com is before $request_uri

I would be better when it catch any websites before files.com, but then i can't control who use it, and as said Maxim it could use more cpu.

I did as say Maxim, but it is question why it don't work, I am using 0.7.24, i see that Coral Content Delivery Network use the same version. They response header is:

Server: nginx/0.7.24 Date: Mon, 16 Feb 2009 12:59:27 GMT Content-Type: image/jpeg Content-Length: 66965 Last-Modified: Mon, 09 Feb 2009 18:14:52 GMT Connection: close Accept-Ranges: none Via: HTTP/1.0 193.63.75.21:8080 (CoralWebPrx/0.1.19 (See http://coralcdn.org/)) Cache-Control: max-age=2595698 Expires: Wed, 18 Mar 2009 12:59:27 GMT

200 OK

Regards, Peter