On Tue, Feb 09, 2010 at 07:01:10PM +0300, Александр Сытар wrote:
> У меня работает на таких настройках:
>
> ## WWW main server
> server {
> listen ip:port;
> server_name some_name;
>
> access_log logs/www.access.log main;
>
> root /usr/share/nginx/www;
>
> location = / {
> rewrite ^ /index.php/ last;
> }
>
> location = /index.php {
> rewrite ^ /index.php/ last;
> }
>
> location / {
> try_files $uri /index.php$uri;
> }
>
> location /index.php {
> internal;
> root /usr/share/nginx/www;
root наследуется с уровня сервера.
> fastcgi_pass backend;
> fastcgi_index index.php;
fastcgi_index здесь не нужен.
> fastcgi_split_path_info ^(.+\.php)(.*)$;
> fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
> fastcgi_param PATH_INFO $fastcgi_path_info;
> include fastcgi_params;
> }
>
> location ~* \.php$ {
> root /usr/share/nginx/www;
root наследуется с уровня сервера.
> fastcgi_pass backend;
> fastcgi_index index.php;
fastcgi_index здесь не нужен.
> fastcgi_split_path_info ^(.+\.php)(.*)$;
> fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
fastcgi_split_path_info здесь не нужен, поскольку path_info здесь всегда
пустой.
> fastcgi_param PATH_INFO $fastcgi_path_info;
> include fastcgi_params;
> }
> }
>
> ### end
Вот правильный конфиг:
root /usr/share/nginx/www;
location / {
try_files $uri @php;
}
location = / {
fastcgi_pass backend;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
include fastcgi_params;
}
location = /index.php {
fastcgi_pass backend;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
include fastcgi_params;
}
location @php {
fastcgi_pass backend;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
fastcgi_param PATH_INFO $uri;
include fastcgi_params;
}
location ~* \.php$ {
fastcgi_pass backend;
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
include fastcgi_params;
}
> Ну и в ЦИ $config['uri_protocol'] = 'PATH_INFO';
>
> 9 февраля 2010 г. 18:24 пользователь smack87 <nginx-forum@nginx.us> написал:
> > изменил nginx.conf так:
> >
> > worker_processes 1;
> >
> > events {
> > worker_connections 1024;
> > }
> >
> >
> > http {
> > include mime.types;
> > default_type application/octet-stream;
> >
> > sendfile on;
> > keepalive_timeout 65;
> >
> >
> > server {
> > listen 80;
> >
> > server_name flashportal.com;
> > charset utf-8;
> >
> > root c:/dev/www/flashportal;
> >
> > rewrite (.*) /index.php?$1 last;
> >
> > location / {
> > try_files $uri $uri/ @codeigniter;
> > }
> >
> > location @codeigniter {
> > fastcgi_pass 127.0.0.1:9123;
> > fastcgi_param SCRIPT_FILENAME $document_root/index.php;
> > fastcgi_param QUERY_STRING $uri;
> > include fastcgi_params1;
> > }
> > }
> > }
> >
> >
> > fastcgi_params1, строку с QUERY удалил
> >
> >
> > fastcgi_param REQUEST_METHOD $request_method;
> > fastcgi_param CONTENT_TYPE $content_type;
> > fastcgi_param CONTENT_LENGTH $content_length;
> >
> > fastcgi_param SCRIPT_NAME $fastcgi_script_name;
> > fastcgi_param REQUEST_URI $request_uri;
> > fastcgi_param DOCUMENT_URI $document_uri;
> > fastcgi_param DOCUMENT_ROOT $document_root;
> > fastcgi_param SERVER_PROTOCOL $server_protocol;
> >
> > fastcgi_param GATEWAY_INTERFACE CGI/1.1;
> > fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
> >
> > fastcgi_param REMOTE_ADDR $remote_addr;
> > fastcgi_param REMOTE_PORT $remote_port;
> > fastcgi_param SERVER_ADDR $server_addr;
> > fastcgi_param SERVER_PORT $server_port;
> > fastcgi_param SERVER_NAME $server_name;
> >
> > # PHP only, required if PHP was built with --enable-force-cgi-redirect
> > fastcgi_param REDIRECT_STATUS 200;
> >
> >
> > перезапустил nginx, в логах ошибок нет:
> >
> > 2010/02/09 17:15:31 1484#924: signal process started
> >
> >
> > Но работает все точно также. Я nginx.conf неправильно изменил? Может я что-то банальное спрашиваю, но мало что понимаю, так как новичек в этом деле
> >
> > Posted at Nginx Forum: http://forum.nginx.org/read.php?21,52637,52653#msg-52653
> >
> >
> > _______________________________________________
> > nginx-ru mailing list
> > nginx-ru@nginx.org
> > http://nginx.org/mailman/listinfo/nginx-ru
> >
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://nginx.org/mailman/listinfo/nginx-ru
--
Игорь Сысоев
http://sysoev.ru
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://nginx.org/mailman/listinfo/nginx-ru