Skip to content

Instantly share code, notes, and snippets.

@williamn
Last active July 7, 2022 03:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save williamn/f4d7a837808419407f86 to your computer and use it in GitHub Desktop.
Save williamn/f4d7a837808419407f86 to your computer and use it in GitHub Desktop.
CodeIgniter on nginx using PHP FPM
upstream php5438 {
server 127.0.0.1:5438;
}
server {
listen 80;
server_name codeigniter.local;
root /var/www/CodeIgniter-2.2.1;
autoindex on;
index index.html index.htm index.php;
access_log /var/log/nginx/codeigniter.local.access.log combined;
error_log /var/log/nginx/codeigniter.local.error.log;
location / {
try_files $uri $uri/ /index.php;
location = /index.php {
fastcgi_pass php5438;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
location ~ \.php$ {
return 444;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment