RE: fastcgi_cache работает как то странно

maxhl at hitline.net.ua maxhl at hitline.net.ua
Wed Apr 1 18:11:27 MSD 2009


Да на дефаулт nginx. В моей конфигурации perl и php работают через
юниксокет. Но нашелся один скрипт который нехочет работать с php-fpm и для
него был сделан проброс на апач. Модуль realip есть и в nginx и в apache. 

user  www www;
worker_processes  2;
pid        /var/run/nginx.pid;
error_log /home/logs/nginx_error.log info;
#error_log /home/logs/nginx_error.log debug;

events {    worker_connections  16384; }

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile       on;
    tcp_nopush     on;
    tcp_nodelay    on;
    server_names_hash_max_size 16384;
    server_names_hash_bucket_size 128;
    client_header_buffer_size 1k;
    large_client_header_buffers 4 4k;
    open_file_cache          max=1000  inactive=20s;
    open_file_cache_valid    30s;
    open_file_cache_min_uses 2;
    open_file_cache_errors   on;
    client_body_temp_path /mnt/md0;
    fastcgi_temp_path /mnt/md0;

    gzip on;
    gzip_min_length 1100;
    gzip_buffers 4 8k;
    gzip_types text/plain;
    output_buffers 1 32k;
    postpone_output 1460;
    keepalive_timeout 75 20;

    fastcgi_connect_timeout 30;
    fastcgi_send_timeout 600;
    fastcgi_read_timeout 600;
    fastcgi_buffer_size 32k;
    fastcgi_buffers 4 32k;
    fastcgi_busy_buffers_size 32k;
    fastcgi_temp_file_write_size 32k;
    fastcgi_intercept_errors on;



    server {

        listen тут мой ип:80;
        server_name короткое имя localhost тут мой ип default;
        access_log /home/logs/default_access.log combined;
        error_log /home/logs/default_error.log info;
        root /home/htdocs;
        index index.pl index.php index.html index.cgi ;
        server_name_in_redirect off;

          location /test.rar {
             root  /home/htdocs/;
          }

               location / {
                   auth_basic            "closed site";
                   auth_basic_user_file  /home/htdocs/.ht_passwd;
                   index index.pl;
               } 
                location ~ .php$ {
                    set $path_info $fastcgi_script_name;
                    set $real_script_name $fastcgi_script_name;
                    if ($fastcgi_script_name ~ "(.+?.php)(/.+)$") {
                        set $real_script_name $1;
                        set $path_info $2;
                    }
                    fastcgi_param SCRIPT_FILENAME
/home/htdocs$real_script_name;
                    fastcgi_param SCRIPT_NAME $real_script_name;
                    fastcgi_param PATH_INFO $path_info;


                    fastcgi_pass unix:/mnt/md0/php-fcgi.sock;
                    include  /usr/local/nginx/conf/phpcgi.conf;
                    fastcgi_param       PHP_INI_ENTRIES "
                                        open_basedir            /home/htdocs
                                        include_path
.:/usr/local/lib/php
                                        error_log
/home/logs/php_htdocs.log
                    ";

                }
                location ~ /index.cgi/ {
                    if ($fastcgi_script_name ~ (.*/index.cgi)/.*$) {
                         set $valid_fastcgi_script_name $1;
                    }

                    fastcgi_pass    unix:/mnt/md0/nginx-fcgi.sock;
                    include  /usr/local/nginx/conf/fastcgi.conf;
                    fastcgi_param       SCRIPT_FILENAME
/home/htdocs$valid_fastcgi_script_name;
                }

                location ~ .pl$  {
                    set $valid_fastcgi_script_name $fastcgi_script_name;
                    if ($fastcgi_script_name ~ /awstats/(.*.pl)$) {
                        set $valid_fastcgi_script_name /awstats/cgi-bin/$1;
                    }
                    fastcgi_param       SCRIPT_FILENAME
/home/htdocs$valid_fastcgi_script_name;
                    fastcgi_pass    unix:/mnt/md0/nginx-fcgi.sock;
                    fastcgi_index    index.pl;
                    include  /usr/local/nginx/conf/fastcgi.conf;
                }

                location /stats {
                    auth_basic            "closed site";
                    auth_basic_user_file  /home/htdocs/stats/.ht_passwd;
                    index index.pl;
                }

                location /sql {
                    index index.php;
                }
    }



-----Original Message-----
From: owner-nginx-ru at sysoev.ru [mailto:owner-nginx-ru at sysoev.ru] On Behalf
Of Igor Sysoev
Sent: Wednesday, April 01, 2009 3:58 PM
To: nginx-ru at sysoev.ru
Subject: Re: fastcgi_cache работает как то странно

On Wed, Apr 01, 2009 at 03:51:17PM +0300, maxhl at hitline.net.ua wrote:

> День добрый. :-)
> Обновился вчера с nginx-0.7.32.tar.gz до nginx-0.7.46.tar.gz В 
> результяте на вирт хост перестали попадать запросы а идут на дефаулт.
> 
>       server {
>             listen тут мой ип:80;
>             server_name test.com *.test.com;
>             access_log /home/logs/bot_access.log combined;
>             error_log /home/logs/bot_error.log info;
>             server_name_in_redirect off;
>             root /home/bot;
>             index index.php index.html;
>             proxy_set_header   X-Real-IP     $remote_addr;
>             # redirect to php
> 
>    location / {
>         proxy_set_header Host $http_host;
>         proxy_set_header X-Real-IP $remote_addr;
> #                   proxy_set_header X-Forwarded-For
> $proxy_add_x_forwarded_;
>         proxy_pass_request_headers on;
>         proxy_pass_request_body on;
>         proxy_pass  http://127.0.0.1:80/;
>         proxy_redirect default;
>     }
> }
> 
> Пришлось вернуть обратно ... :-(
> 
> Что то изменилось в директивах конфига ?

На дефолт чего - nginx'а или Апача ?


--
Игорь Сысоев
http://sysoev.ru







More information about the nginx-ru mailing list