Nginx config and trim removing necessary opening slash |
[eluser]Unknown[/eluser]
Hello. New here though I've been coding my CI application for few months now. It's an open source comics reader. I've been using the "tip" from bitbucket, because some issues in 2.0.2 were in my way. Still, I think this applies for other versions of CI2 as well. Today I was trying to make a CLI interface for allowing safer database upgrades, and realized I needed to set the $config['uri_protocol'] to "AUTO". Didn't work at all, because I was using Nginx 0.8.5 with "REQUEST_URI". So I decided to get into it to finally get nginx to work with "AUTO", so I could have the application to be more compatible with other servers in general, since it's a publicly distributed application. So, with "REQUEST URI" this used to work (removing all unnecessary caching and security parts): Code: [In the nginx config] "if" is ugly on Nginx, and there's try_files. Now with try_files, the most classic version of it, and "AUTO", the browser redirects indefinitely. Code: [In the nginx config] Checking how the variable changes in URI.php, it starts with "/manga/beta3/admin/database/upgrade/" coming from $_SERVER['REQUEST_URI'], and at line 196: Code: [/system/core/URI.php line 196 in _detect_uri()] It removes the opening slash, which causes the infinite redirect. By just adding it on line 74, Code: [/system/core/URI.php line 74] the try_files works just fine with Codeigniter. So, "is this a bug?" or there's some Nginx setup that can work with it, without me messing with Codeigniter? For now I am going to make it work with a MY_ file, but I wondered if all the weird Nginx 0.7+ configurations I found in this forum were caused by this. |
Welcome Guest, Not a member yet? Register Sign In |