Welcome Guest, Not a member yet? Register   Sign In
Nginx config

Hey everyone!
I have Apache on my local site.
I have Nginx on my live site.

I have Apache .htaccess

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index\.php|css|images|robots\.txt|css)
    RewriteRule ^(.*)$ /index.php/$1 [L]

How should I configure nginx?

Now my live site works only for http://example.com/.
Other URLs like http://example.com/abc/def/1 produce "nginx - not found" error.

Did you create a config file for nginx for your project? If you google "nginx+codeigniter" you will find some to try out.

[eluser]Abel A.[/eluser]
Here's my nginx config

server {
    server_name mysite.com www.mysite.com;
    root /home/abel/public_html;
    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ /index.php;

    include php;
    access_log off;

The CI stuff is just in the location segment, the rest is standard.

Theme © iAndrew 2016 - Forum software by © MyBB