Welcome Guest, Not a member yet? Register   Sign In
nginx with base_url adds the base url

I'm trying to version my app, such that /0.0.1/ is the API for version 0.0.1, and so on.
My nginx rewrite for that is:

location / {
    try_files $uri $uri/ @rewrite;

location @rewrite {
    rewrite ^(/\d\.\d\.\d)(/.*)$  /stage/$1/api/index.php?q=$2&$args last;
    rewrite ^                     /index.php?q=$uri&$args last;

Which technically works, and reaches CI.
Going to this URL: "api.url.com/0.0.1/genders" for example, I get a 404.

Printing `$_GET` says there is one parameter, "q", with value "/genders";
Printing the uri segments gives me:
[0] => 0.0.1
[1] => genders

I tried setting `base_url` to "/0.0.1/" and also to the full path, but no luck, same segments that I think are causing a 404.

What am I doing wrong?

Did you ever figure it out? I have the exact same problem.

Theme © iAndrew 2016 - Forum software by © MyBB