nginx phtml .htaccess error

chillivilli nginx-forum на nginx.us
Пт Фев 10 06:37:06 UTC 2012


Полный конфиг.

#user  nobody;
worker_processes  4;

error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;

events {
    worker_connections  6000;
    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"';

    #access_log  logs/access.log  main;
    reset_timedout_connection on;
    sendfile       on;
    tcp_nopush     on;
    tcp_nodelay    on;
    server_tokens off;
    keepalive_timeout 3;
    ignore_invalid_headers on;

limit_zone one $binary_remote_addr 10m;
limit_req_zone  $binary_remote_addr zone=req:10m rate=70r/s;
limit_req_zone  $binary_remote_addr zone=search:10m rate=1r/s;

    gzip  on;
    gzip_comp_level 4;

    proxy_temp_path /var/db/nginx/proxy_temp;
    proxy_cache_path /var/db/nginx/cache levels=1:2 keys_zone=all:30m;

upstream backend {
    server 1:8081 weight=9 max_fails=1 fail_timeout=40s;
    server 2:8081 weight=1 max_fails=1 fail_timeout=40s down;
    server 3:8081 weight=4 max_fails=1 fail_timeout=40s down;
}

upstream stata {
    server 127.0.0.1:8082;
}


    server {
        listen       443 ssl default_server;

        limit_conn one 200;
        limit_req zone=req burst=50;
        keepalive_timeout 10;
        server_name  sait.ru;
        access_log  logs/access_sait.ru.log  main;
        error_page  404              /error/page404;
        ssl                  on;
        ssl_certificate      /etc/ssl/key.pem;
        ssl_certificate_key  /etc/ssl/privatekey.crt;
#       ssl_verify_depth 3;
        ssl_session_timeout  10;
        ssl_protocols  SSLv3 TLSv1;
        ssl_ciphers  AES256-SHA:RC4-SHA;
        ssl_prefer_server_ciphers   on;
        ssl_session_cache shared:SSL:10m;

        location ~ /\.ht {
        deny all;
        }

        location ~ \.phtml$ {
        deny all;
        }

        location / {
        if ($host ~* ^(сайт.рф)$) {
        rewrite ^/(.*)$ https://sait.ru/$1 permanent;
        }


        #limit_conn one 20;
        #limit_req zone=req burst=100;
        proxy_pass   http://backend/;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        #client_max_body_size 10m;
        #client_body_buffer_size 500k;
        #client_body_temp_path /var/nginx/client_body_temp;
        proxy_connect_timeout 4;
        proxy_send_timeout    90;
        proxy_read_timeout    90;
        #proxy_send_lowat       12000;
        proxy_buffer_size 4k;
        proxy_buffers           4 32k;
        proxy_busy_buffers_size    64k;
        #proxy_temp_file_write_size 64k;
        #proxy_cache all;
        #proxy_cache_valid 5m;
        }

        }


      location ~*
^.+.(jpg|jpeg|css|html|gif|png|ico|css|zip|tgz|gz|rar|js|txt|pdf)$
         
{
            root   /var/www/sait.ru/public;
            access_log off;
            expires 3d;
                valid_referers none blocked server_names
                *.sait.ru.ru
                ~\.google\.
                images.yandex.ru
                sait.ru
                *.c.sait.ru;
                if ($invalid_referer)  {
                    return 403;
                }
        }

        location /nginx_status {
        stub_status on;
        access_log off;
        allow x;
        allow y;
        deny all;
        }

        location /astat/
        {
        limit_req zone=search burst=60;
        proxy_pass   http://stata/server-status/;
        proxy_redirect off;
        allow x;
        deny all;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_connect_timeout 4;
        proxy_send_timeout    90;
        proxy_read_timeout    90;
        }

        if ($host !~* ^(c.sait.ru|sait.ru|сайт.рф)$ ){
         rewrite ^/(.*)$ https://sait.ru/$1 permanent;
        }


}

Posted at Nginx Forum: http://forum.nginx.org/read.php?21,222173,222202#msg-222202



Подробная информация о списке рассылки nginx-ru