Re: rewrite

sytar.alex gmail.com
9 19:01:10 MSK 2010


     :

## 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;
		fastcgi_pass backend;
		fastcgi_index index.php;
		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;
		fastcgi_pass backend;
		fastcgi_index index.php;
		fastcgi_split_path_info         ^(.+\.php)(.*)$;
		fastcgi_param  SCRIPT_FILENAME  $fastcgi_script_name;
		fastcgi_param  PATH_INFO        $fastcgi_path_info;
		include	fastcgi_params;
	}
}

### end

     $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