Yii Framework Forum: nginx 404 not found Path URL style - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

nginx 404 not found Path URL style getitng a 404 in path style URL under nging with index.php visible. Rate Topic: -----

#1 User is offline   Arvind 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 03-October 09
  • Location:Calgary, AB, Canada

Posted 09 February 2010 - 04:47 AM

Hello,

I have been following this link to configure nginx
http://www.yiiframew...oc/cookbook/15/

This is how my config looks like
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
}

I can open http://localhost/dtruck/
but anything after that i see this error in the log file.

2010/02/09 02:41:59 [error] 7325#0: *1 open() "/data/inetpub/www/dtruck/index.php/site/login" failed (20: Not a directory), client: 127.0.0.1, server: localhost, request: "GET /dtruck/index.php/site/login HTTP/1.1", host: "localhost", referrer: "http://localhost/dtruck/index.php"


Can somebody please help me, what i have missed ? I dont want to hide the index.php for now.


Arvind
0

#2 User is offline   Arvind 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 03-October 09
  • Location:Calgary, AB, Canada

Posted 16 February 2010 - 03:44 AM

Hello,

I think I found the solution to have this working
"myapplication/index.php/controller/action "


location ~ ^(.+\.php)(.*)$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
}


But one thing to remember is that , displaying index.php is probably getting outdated and not a clean url style. Most places index.php is being hidden and that is also the way to go.

then in that case, we dont need that complex RegExp
~ ^(.+\.php)(.*)$
fastcgi_split_path_info ^(.+\.php)(.*)$;


and we can use this to hide the index.php

location /myapplication {
try_files $uri /myapplication/index.php;
}


thanks
Arvind
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users