title: NGINX server configuration for Codeigniter
body: <p>/etc/nginx/conf.d/default.conf</p>
  
  <pre><code>server{
  listen 80;
  listen [::]:80;
  server_name  192.168.56.101 192.168.101.100 localhost;
  root   /var/www/html;
  index index.php index.html index.htm;
  
  location / {
      try_files $uri $uri/ =404;
  }
  
  error_page 404 /404.html;
  error_page 500 502 503 504 /50x.html;
  
  location = /50x.html {
      root /var/www/html;
  }
  
  location ~ \.php$ {
      try_files $uri =404;
      fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      include fastcgi_params;
  }
  
  
  location ~ /\.ht {
      deny all;
  }
  }
  </code></pre>
  
  <hr>
  
  <p>my codeigniter folder is 'ci' which is located in /var/www/html/ci
  what configuration do I need to work url rewriting?...</p>