Другое Настройка Nginx на сервере ispmanager

bolivarnsk

Создатель
Регистрация
1 Авг 2009
Сообщения
23
Реакции
20
Код:
    location / {
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
        location ~* ^.+\.(aac|au|avi|bak|bmp|css|doc|docx|eot|gif|gz|bz2?|htc|ico|jpeg|jpg|js|mp3|mp4|ogg|mpe?g|mpg|odb|odf|odg|odp|ods|odt|otf|pdf|png|ppt?x|psd|rar|scss|svg|tar|tgz|ttf|wav|wmv|woff|xls?x|xml|zip|swf)$ {
            access_log off;
            expires 45d;
            break;
        }
        try_files $uri $uri/ @rewrite;
    }
    location ~ ^/(index|admin/index|install/index)\.php {
        index index.php;
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
    }
    location ~* \.(php|log|tpl|txt|twig|xml|ini)$ {
        deny all;
    }
    location /system {
        rewrite ^/system/storage/(.*) /index.php?route=error/not_found last;
    }
    location ~ /\. {
        deny all;
    }
    location ~ ^/system/ {
        deny all;
    }
    location ~* /\.(svn|hg|git) { deny all; }
    location = /humans.txt  { allow all; access_log off; }
    location ~ /ht\.    { deny all; }
    location = /favicon.ico {
        allow all;
        log_not_found off;
        access_log off;
    }
    location = /robots.txt {
        allow all;
    }
    location = /sitemap.xml {
        allow all;
        rewrite ^/(.*)$ /index.php?route=extension/feed/google_sitemap last;
    }
    location ~ /\.((?!well-known|default)) {
        deny all;
        access_log off;
        log_not_found off;
        return 404;
    }
    location @rewrite {
        rewrite ^/(.+)$ /index.php?_route_=$1 last;
    }
    location @php {
        fastcgi_index index.php;
        fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f ...";
        fastcgi_pass unix:/var/www/php-fpm/host.sock;
        fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
        try_files $uri =404;
        include fastcgi_params;
    }

Может кому пригодится
 
Назад
Сверху