nginx configuration for URL URI paths

Posted by hachiari on Server Fault See other posts from Server Fault or by hachiari
Published on 2010-05-18T12:55:01Z Indexed on 2010/05/18 13:02 UTC
Read the original article Hit count: 328

Filed under:
|
|
|

I want to switch my webserver from apache to nginx however I have difficulties in converting my current htaccess to nginx configuration

the conditions that I need:

  1. I want everything to be like apache, it can read file such as js, css, jpg, png ,etc
  2. I am currently using CodeIgniter PHP frameword, it uses the URI system thingy... So my htaccess configuration for CodeIgniter URI is:

    RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] RewriteCond %{HTTP_HOST} ^www.domain.tld [NC] RewriteRule ^(.*)$ hxtp://domain.tld/$1 [L,R=301]

  3. I am also using minify to compress my css and js files, so the way I call my css and js is like: hxtp://domain.tld/?=css hxtp://domain.tld/?=js

I tried some configurations from the net, but I could only solve problem no 2

Thank You

© Server Fault or respective owner

Related posts about nginx

Related posts about configuration