• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
nginx with base_url adds the base url

#1
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:

Code:
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:
Quote:(
[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?
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.