P
P
Puma Thailand2012-08-19 08:35:55
Nginx
Puma Thailand, 2012-08-19 08:35:55

How to redirect requests from location to proxy using regexp?

The essence of the problem, there is nginx before apache
In nginx there is a rule for static
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
log_not_found off;
access_logoff;
}

I'm trying to fasten the css and js compressor
It sends all requests to /skin/m/pathwithallfiles
The problem is that on the way it sends a list of all css and js files, that is, the url ends with either .js or .css
And it is caught by the rule for statics, but you need to pass it to apache.
Can't use regexp for proxypass in nginx location ~* /skin/m

[emerg]: "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

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Slinko, 2012-08-19
@KeepYourMind

location /skin {
    proxy_pass
}

location / {
    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question