Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter for nginx
#1

[eluser]Unknown[/eluser]
I have install a CodeIgniter on ngnix, I have add this rewrite rule but doesn't work.
Now I get in to the site, it show the 502 Bad Gateway error.
Does any one can help me? I'm a newer.
Thanks

if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}

My conf:
==============================
server
{
listen 80;
server_name xxxx;
index index.php index.htm index.html default.html default.htm default.php;
root /home/wwwroot/xxxx;

include other.conf;
location ~ .*\.(php|php5)?$
{
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}

location ~ .*\.(js|css)?$
{
expires 12h;
}

location / {
index index.php;
#root /home/wwwroot/xxxx
if (!-e $request_filename) {
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/wwwroot/xxxx/index.php;
}


log_format xxxx '$remote_addr - $remote_user [$time_local] $request '
'$status $body_bytes_sent $http_referer '
'$http_user_agent $http_x_forwarded_for';
access_log xxxx.log xxxx;
========================================
#2

[eluser]Unknown[/eluser]
anyone can help?




Theme © iAndrew 2016 - Forum software by © MyBB