Dealing with multiple parameters in Nginx rewrite
Posted
by x3sphere
on Stack Overflow
See other posts from Stack Overflow
or by x3sphere
Published on 2010-04-22T10:32:40Z
Indexed on
2010/04/25
9:23 UTC
Read the original article
Hit count: 365
I have a rewrite that nginx calls like so:
location ~* (css)$ {
rewrite ^(.*),(.*)$ /min/index.php?f=$1,/min/$2 last;
}
And it's used on pages like this:
http://domain.com/min/framework.css,dropdown.css
Works all fine and dandy, but it's not scalable. Adding another element to the URL means I have to directly edit the nginx config. Ideally, I'd like to have nginx rewrite according to how many comma-delimited parameters are passed through the URL, rather than setting a fixed amount in the config. Is this possible?
© Stack Overflow or respective owner