i setup nginx and it’s working great for us for static files. I’m
wondering
if nginx would be suited for the following scenario:
We have an application server that has a lot of .php files and even more
static files (.gif, .jpg etc).
Can i put nginx in front of if like a proxy but have nginx cache the
static
files (everything except the .php stuff). So that only .php requests
reach
the server and the static files will be cached on the nginx machine once
the
get retrieved from the upstream server.
I’ve been trying to fix the cache for a nginx configured like reverse
proxy; I’m using these configuration parameter in my nginx.conf;
however, when I try to login to my back-end server, the server shows me
the next message in browser: “Your session has expired.”
I am also trying to get the caching to work. Whenever I use the
proxy_cache_path or proxy_cache directive I get this error when starting
nginx and it fails to start- unknown directive “proxy_cache” - unknown
directive “proxy_cache_path”. Anyone know what I’m doing wrong? I am
using Ubuntu 9.04 and installed NGINX from the repos.
Thx to all of you. I love how active and productive this group is. Gonna
give it a try with Igors hints and will check out the ncache on the next
weekend.
On Mon, Oct 19, 2009 at 06:06:25PM -0400, avery wrote:
I am also trying to get the caching to work. Whenever I use the proxy_cache_path or proxy_cache directive I get this error when starting nginx and it fails to start- unknown directive “proxy_cache” - unknown directive “proxy_cache_path”. Anyone know what I’m doing wrong? I am using Ubuntu 9.04 and installed NGINX from the repos.
Cache support first appeared in nginx 0.7.45. Ubuntu 9.04 seems
to have 0.6.35 in the package list.
I haven’t personally tested it, but I doubt it if they are originating
from the same server. Maybe someone else will have actually run the
numbers. I am catching files that are being served using a reverse
proxy, which I’ve found helps out a fair amount.
: “proxy_pass” may not have URI part in location
Ivo
Hm I found out what the problem was,
You cant have proxy_pass http://ip:port if you have a regexp in the
location directive, if you do - you need to define upstream first :
upstream php_server {
server http://ip:port/;
}
and then
proxy_pass http://php_server;
When I try using proxy_pass within location ~ something I get :
: “proxy_pass” may not have URI part in location given by regular
expression, or inside named location, or inside the “if” statement, or
inside the “limit_except” block in /etc/nginx/nginx.conf:52
On Mon, Oct 19, 2009 at 06:06:25PM -0400, avery wrote:
I am also trying to get the caching to work. Whenever I use the proxy_cache_path or proxy_cache directive I get this error when starting nginx and it fails to start- unknown directive “proxy_cache” - unknown directive “proxy_cache_path”. Anyone know what I’m doing wrong? I am using Ubuntu 9.04 and installed NGINX from the repos.
Cache support first appeared in nginx 0.7.45. Ubuntu 9.04 seems
to have 0.6.35 in the package list.
Maxim D.
Hi, I have a similar error with version 0.8.36…
[emerg]: unknown directive “proxy_cache_path” in
/usr/local/nginx/nginx.conf:33
On Fri, Oct 30, 2009 at 06:59:32AM -0400, infestdead wrote:
scenario:
on the nginx machine once the
location ~ .php$ {
location ~ .(gif|jpg|png)$ {
all:r;
When I try using proxy_pass within location ~ something I get :
: “proxy_pass” may not have URI part in location given by regular expression, or inside named location, or inside the “if” statement, or inside the “limit_except” block in /etc/nginx/nginx.conf:52
Solved: the problem only appears if all the configuration is in the
nginx.conf. Using “include files” works ok. My mistate, I thought both
solution are equivalent.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.