Welcome! Log In Create A New Profile

Advanced

nginx location problem codeigniter

Posted by tuurtnt 
nginx location problem codeigniter
June 21, 2011 06:01PM
Hi guys,

first of all, nginx & php-fpm rules but I have a question/problem.

I have a codeigiter project (it's a website with a cms, frontend backend application). Backend is located in
location /admin/

this works perfectly... but the frontend uses SEO rewrited urls, for example: www.test.com/home.html (home.html does not really exists)
in my nginx config i use this:
==========================
location /admin/
{
try_files $uri $uri/ @admin;
}

location /
{
try_files $uri $uri/ @frontend;
}

location @admin
{
rewrite ^/admin/(.*)$ /admin/index.php?/$1 last;
break;
}

location @frontend
{
rewrite ^(.*) /index.php?/$1 last;
break;
}
==========================
The admin section works perfectly (does not use SEO urls) but the frontend does not work, he gives a 404 because nginx can't find the home.html file... Is there a solution for this?

Thanks in advance!
Re: nginx location problem codeigniter
June 22, 2011 03:56PM
anyone an idea?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 151
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready