Location Nginx ISP

Nicolayka

Проверенные
Сообщения
81
Реакции
14
Баллы
5,505
Всем добрый день. Прчоитал все темы про nginx на этом форуме и не только, но ответа не нашёл. У меня имеется NGINX, php-fpm и самое главное - ISPManager

Есть сайт - site.ru. Он находится в папке /site

Есть форум, он же должен находится в папке /forum

Вот мой конфиг.
Код:
#user 'site' virtual host 'site.ru' configuration file
server {
    server_name site.ru www.site.ru;
    charset UTF-8;
    disable_symlinks if_not_owner from=$root_path;
    index index.html index.php;
    root $root_path;
    set $root_path /var/www/site/data/www/site.ru/site;
    access_log /var/www/httpd-logs/site.ru.access.log ;
    error_log /var/www/httpd-logs/site.ru.error.log notice;
    include /etc/nginx/vhosts-includes/*.conf;
    include /etc/nginx/vhosts-resources/site/*.conf;
    location / {
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
    }
    location /webstat/ {
        charset UTF-8;
        index index.html;
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
        auth_basic "Access limited by ISPmanager";
        auth_basic_user_file /var/www/site/data/etc/access.site.ru.VihQs/3k.passwd;
    }
  
    location /forum/ {
        try_files $uri $uri/ /forum/index.php?$uri&$args;
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
    }
    location ^~ /library/ {
        internal;
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
    }
    location ^~ /internal_data/ {
        internal;
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
    }
    location /forum/admin.php {
        allow 86.72.15.162;
        deny all;
        rewrite ^(.*)$ https://$http_host$request_uri redirect;
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
    }

    location @php {
        fastcgi_index index.php;
        fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f [email protected]";
        fastcgi_pass unix:/var/www/php-fpm/site.sock;
        fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
        try_files $uri =404;
        include fastcgi_params;
    }
    ssi on;
    gzip on;
    gzip_comp_level 4;
    listen 1.2.3.4:80 default_server;
}

При этом конфиге на главную страницу форума попасть невозможно, браузер скачивает файлы с таким содержимым
Код:
<?php

$startTime = microtime(true);
$fileDir = dirname(__FILE__);

require($fileDir . '/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');

XenForo_Application::initialize($fileDir . '/library', $fileDir);
XenForo_Application::set('page_start_time', $startTime);

$fc = new XenForo_FrontController(new XenForo_Dependencies_Public());
$fc->run();


Подскажите, как настроить форум. Спасибо!
 
Последнее редактирование:
Современный облачный хостинг провайдер | Aéza
Назад
Сверху Снизу