It looks like you're new here. If you want to get involved, click one of these buttons!
location / {
if ($request_filename !~ (js|css|images|img|robots\.txt|index\.php.*) ) {
rewrite ^/(.*)$ /index.php/$1 last;
}
location ~ /index.php/ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/knight/public/$fastcgi_script_name;
}
Comments
http://www.getfuelcms.com/forums/discussion/comment/323/#Comment_323
my setup
ubuntu natty
php-fpm
nginx 1.0.4
all install done by apt-get
*replace domain.com with your own domain
*replace home_path with your actual path
edit the vhost on /etc/nginx/site-available/domain.com
server { listen 80; server_name www.domain.com; rewrite ^/(.*) http://domain.com/$1 permanent; } server { listen 80; server_name domain.com; access_log /home_path/log/access.log; error_log /home_path/log/error.log; location / { root /home_path/public/; index index.php index.html; if ($request_filename !~ (js|css|images|img|robots\.txt|index\.php.*) ) { rewrite ^/(.*)$ /index.php/$1 last; } if (!-f $request_filename) { rewrite ^/(.*)(fuel/modules/.*) /$2 last; rewrite ^/(.*)(/assets/.*) /$2 last; } location ^~ /fuel/crons { deny all; } location ^~ /fuel/data_backup { deny all; } } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 location ~ /index.php/ { fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_index index.php; include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME /home_path/public$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; } }
once you done this, you might still see error, test it the login page http://domain.com/fuel/login/ , if this display properly, which mean the rewrite rules is working, checking on the error.log you will see there is some upstream error, which prevent the site to display properly.
Just create /etc/nginx/conf.d/buffer.conf and leave these value in the conf file
fastcgi_buffers 8 16k; fastcgi_buffer_size 32k;
restart your nginx and you should be able to see your shining fuelcms working!