Re: Nginx

Alexander Kochetov kochetov.alexander gmail.com
4 19:13:16 MSK 2009


    ?   root  ,   server,   location /my/

 :
                   if (!-e $request_filename)
                       {
                       rewrite ^/$ /my/ permanent;
                       }
    .

--
Alexander Kochetov



4  2009 . 18:27  100matolog <nginx-forum at nginx.us> :
>      nginx (  )
>    - .  http://fpm.test.ru/my/
> 
>
> fpm# cat nginx.conf
> user www www;
> worker_processes 100;
> worker_priority -5;
> worker_rlimit_nofile 51200;
>
> events {
>  worker_connections 51200;
>  use         kqueue;
> }
>
> http {
>  include       mime.types;
>  default_type    application/octet-stream;
>
>  log_format main  '$remote_addr - $remote_user [$time_local] $request '
>            '"$status" $body_bytes_sent "$http_referer" '
>            '"$http_user_agent" "$http_x_forwarded_for"';
>
>  server_names_hash_bucket_size    512;
>  sendfile      on;
>  tcp_nopush     on;
>  keepalive_timeout  70 30;
>  send_timeout    30s;
>  reset_timedout_connection  on;
>  resolver      127.0.0.1;
>  resolver_timeout  10s;
>
>  open_file_cache       max=100000 inactive=40s;
>  open_file_cache_valid    60s;
>  open_file_cache_min_uses  2;
>  open_file_cache_errors   on;
>
>
> ########################SERVER_LOCALHOST##############################
>
>  server {
>    listen     80;
>    server_name   fpm.test.ru;
>    client_max_body_size 101M;
>    location / {
>      root    /usr/local/www/della/htdocs/;
>      index    index.html, index.php ;
>      access_log /var/log/nginx/localhost-access.log   main;
>      error_log /var/log/nginx/localhost-error.log    error;
>
>          }
>
> #####################################################################
> ##################   REWRITE         #####################
>
>  location /my/    {
>            if (!-e $request_filename)
>            {
>            rewrite ^/$ /my/ permanent;
>            }
>            }
>
> ###################    PHP-FPM       ######################
>
>
> location ~* \.php$ {
>      fastcgi_pass    127.0.0.1:9000;
>      fastcgi_index    index.php;
>      fastcgi_param    SCRIPT_FILENAME /usr/local/www/della/htdocs/$fastcgi_script_name;
>      include       fastcgi_params;
>    }
>
>
> error_page   500 502 503 504     /50x.html;
>    location = /50x.html {
>      root    /usr/local/www/nginx-dist;
>    }
> }
>
> }
>
>
>   -   404 Not Found
>  
>
> 2009/12/04 17:19:35 45276#0: *7 "/usr/local/etc/nginx/html/my/index.html" is not found (2: No such file or directory), client: 10.100.101.14, server: fpm.test.ru, request: "GET /my/ HTTP/1.1", host: "fpm.test.ru", referrer: "http://fpm.test.ru/"
>
>
>        "/usr/local/etc/nginx/html/my/....
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?21,27971,27971#msg-27971
>
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru at nginx.org
> http://nginx.org/mailman/listinfo/nginx-ru
>



nginx-ru