nginx проблема

Статус
В этой теме нельзя размещать новые ответы.

andrey0954

Заблокирован
Сообщения
49
Реакции
8
Баллы
305
уже задавал этот вопрос, извиняюсь что дублирую, не нашёл выход из ситуации. ничего не помогает.
установлен FastCGI (Nginx + PHP-FPM)

уже пробовал прописывать код
Код:
try_files $uri $uri/ /index.php?$uri&$args;
- не помогает (при переходе на главную страницу форума, какого х=я скачивается файл "без названия")
лог полностью менял - тоже самое.

ребята, извините что за=бываю. ткните носом, мне, котёнку. пожалуйста. что в коде не так?
вот мой nginx

Код:
server {
    server_name litcourse.club www.litcourse.club;
    charset UTF-8;
    index index.php index.html;
    disable_symlinks if_not_owner from=$root_path;
    include /etc/nginx/vhosts-includes/*.conf;
    include /etc/nginx/vhosts-resources/litcourse.club/*.conf;
    access_log /var/www/httpd-logs/litcourse.club.access.log;
    error_log /var/www/httpd-logs/litcourse.club.error.log notice;
    ssi on;
    return 301 https://$host:443$request_uri;
    set $root_path /var/www/andrey/data/www/litcourse.club;
    root $root_path;
    gzip on;
    gzip_comp_level 5;
    gzip_disable "msie6";
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
    location / {
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
        location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
            expires 30s;
        }
    }
    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/andrey.sock;
        fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
        try_files $uri =404;
        include fastcgi_params;
    }
    listen 80.89.234.203:80;
}
server {
    server_name litcourse.club www.litcourse.club;
    ssl_certificate "/var/www/httpd-cert/andrey/litcourse.club_le1.crtca";
    ssl_certificate_key "/var/www/httpd-cert/andrey/litcourse.club_le1.key";
    ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
    ssl_prefer_server_ciphers on;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    add_header Strict-Transport-Security "max-age=31536000;";
    ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
    charset UTF-8;
    index index.php index.html;
    disable_symlinks if_not_owner from=$root_path;
    include /etc/nginx/vhosts-includes/*.conf;
    include /etc/nginx/vhosts-resources/litcourse.club/*.conf;
    access_log /var/www/httpd-logs/litcourse.club.access.log;
    error_log /var/www/httpd-logs/litcourse.club.error.log notice;
    ssi on;
    set $root_path /var/www/andrey/data/www/litcourse.club;
    root $root_path;
    gzip on;
    gzip_comp_level 5;
    gzip_disable "msie6";
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
    location / {
        location ~ [^/]\.ph(p\d*|tml)$ {
            try_files /does_not_exists @php;
        }
        location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|swf)$ {
            expires 30s;
        }
    }
    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/andrey.sock;
        fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
        try_files $uri =404;
        include fastcgi_params;
    }
    listen 80.89.234.203:443 ssl;
}
 
Решение
Код:
server {
    server_name litcourse.club www.litcourse.club;
    charset UTF-8;
    index index.php index.html;
    disable_symlinks if_not_owner from=$root_path;
    include /etc/nginx/vhosts-includes/*.conf;
    include /etc/nginx/vhosts-resources/litcourse.club/*.conf;
    access_log /var/www/httpd-logs/litcourse.club.access.log;
    error_log /var/www/httpd-logs/litcourse.club.error.log notice;
    return 301 https://$host:443$request_uri;
    listen 80.89.234.203:80;
}
server {
    server_name litcourse.club www.litcourse.club;
    ssl_certificate "/var/www/httpd-cert/andrey/litcourse.club_le1.crtca";
    ssl_certificate_key "/var/www/httpd-cert/andrey/litcourse.club_le1.key";
    ssl_ciphers...
Последнее редактирование:
andrey0954,
ЧПУ для XenForo
сейчас в очередной раз попробую
просьба пока что не закрывать тему

быть может найдётся спасатель, который сможет за меня - "инвалида", код подправить?
буду безмерно благодарен
 
Код:
server {
    server_name litcourse.club www.litcourse.club;
    charset UTF-8;
    index index.php index.html;
    disable_symlinks if_not_owner from=$root_path;
    include /etc/nginx/vhosts-includes/*.conf;
    include /etc/nginx/vhosts-resources/litcourse.club/*.conf;
    access_log /var/www/httpd-logs/litcourse.club.access.log;
    error_log /var/www/httpd-logs/litcourse.club.error.log notice;
    return 301 https://$host:443$request_uri;
    listen 80.89.234.203:80;
}
server {
    server_name litcourse.club www.litcourse.club;
    ssl_certificate "/var/www/httpd-cert/andrey/litcourse.club_le1.crtca";
    ssl_certificate_key "/var/www/httpd-cert/andrey/litcourse.club_le1.key";
    ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
    ssl_prefer_server_ciphers on;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    add_header Strict-Transport-Security "max-age=31536000;";
    ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
    charset UTF-8;
    index index.php index.html;
    disable_symlinks if_not_owner from=$root_path;
    include /etc/nginx/vhosts-includes/*.conf;
    include /etc/nginx/vhosts-resources/litcourse.club/*.conf;
    access_log /var/www/httpd-logs/litcourse.club.access.log;
    error_log /var/www/httpd-logs/litcourse.club.error.log notice;
    ssi on;
    set $root_path /var/www/andrey/data/www/litcourse.club;
    root $root_path;
    gzip on;
    gzip_comp_level 5;
    gzip_disable "msie6";
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
   
    location / {
                try_files $uri $uri/ /index.php?$uri&$args;
        }

    location ~ /(internal_data|library|src)/ {
        internal;
        }

    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/andrey.sock;
        fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
        try_files $uri =404;
        include fastcgi_params;
    }
    listen 80.89.234.203:443 ssl;
}
 
andrey0954, а ты nginx перезагружал?
да

Код:
server {
    server_name litcourse.club www.litcourse.club;
    charset UTF-8;
    index index.php index.html;
    disable_symlinks if_not_owner from=$root_path;
    include /etc/nginx/vhosts-includes/*.conf;
    include /etc/nginx/vhosts-resources/litcourse.club/*.conf;
    access_log /var/www/httpd-logs/litcourse.club.access.log;
    error_log /var/www/httpd-logs/litcourse.club.error.log notice;
    return 301 https://$host:443$request_uri;
    listen 80.89.234.203:80;
}
server {
    server_name litcourse.club www.litcourse.club;
    ssl_certificate "/var/www/httpd-cert/andrey/litcourse.club_le1.crtca";
    ssl_certificate_key "/var/www/httpd-cert/andrey/litcourse.club_le1.key";
    ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
    ssl_prefer_server_ciphers on;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    add_header Strict-Transport-Security "max-age=31536000;";
    ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
    charset UTF-8;
    index index.php index.html;
    disable_symlinks if_not_owner from=$root_path;
    include /etc/nginx/vhosts-includes/*.conf;
    include /etc/nginx/vhosts-resources/litcourse.club/*.conf;
    access_log /var/www/httpd-logs/litcourse.club.access.log;
    error_log /var/www/httpd-logs/litcourse.club.error.log notice;
    ssi on;
    set $root_path /var/www/andrey/data/www/litcourse.club;
    root $root_path;
    gzip on;
    gzip_comp_level 5;
    gzip_disable "msie6";
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
  
    location / {
                try_files $uri $uri/ /index.php?$uri&$args;
        }

    location ~ /(internal_data|library|src)/ {
        internal;
        }

    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/andrey.sock;
        fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
        try_files $uri =404;
        include fastcgi_params;
    }
    listen 80.89.234.203:443 ssl;
}
вот что в файле

Код:
<?php

$phpVersion = phpversion();
if (version_compare($phpVersion, '5.6.0', '<'))
{
    die("PHP 5.6.0 or newer is required. $phpVersion does not meet this requirement. Please ask your host to upgrade PHP.");
}

$dir = __DIR__;
require($dir . '/src/XF.php');

XF::start($dir);

if (\XF::requestUrlMatchesApi())
{
    \XF::runApp('XF\Api\App');
}
else
{
    \XF::runApp('XF\Pub\App');
}
 
Код:
server {
    server_name litcourse.club www.litcourse.club;
    charset UTF-8;
    index index.php index.html;
    disable_symlinks if_not_owner from=$root_path;
    include /etc/nginx/vhosts-includes/*.conf;
    include /etc/nginx/vhosts-resources/litcourse.club/*.conf;
    access_log /var/www/httpd-logs/litcourse.club.access.log;
    error_log /var/www/httpd-logs/litcourse.club.error.log notice;
    return 301 https://$host:443$request_uri;
    listen 80.89.234.203:80;
}
server {
    server_name litcourse.club www.litcourse.club;
    ssl_certificate "/var/www/httpd-cert/andrey/litcourse.club_le1.crtca";
    ssl_certificate_key "/var/www/httpd-cert/andrey/litcourse.club_le1.key";
    ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
    ssl_prefer_server_ciphers on;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    add_header Strict-Transport-Security "max-age=31536000;";
    ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
    charset UTF-8;
    index index.php index.html;
    disable_symlinks if_not_owner from=$root_path;
    include /etc/nginx/vhosts-includes/*.conf;
    include /etc/nginx/vhosts-resources/litcourse.club/*.conf;
    access_log /var/www/httpd-logs/litcourse.club.access.log;
    error_log /var/www/httpd-logs/litcourse.club.error.log notice;
    ssi on;
    set $root_path /var/www/andrey/data/www/litcourse.club;
    root $root_path;
    gzip on;
    gzip_comp_level 5;
    gzip_disable "msie6";
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
  
    location / {
                try_files $uri $uri/ /index.php?$uri&$args;
        }

    location ~ /(internal_data|library|src)/ {
        internal;
        }

    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/andrey.sock;
        fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
        try_files $uri =404;
        include fastcgi_params;
    }
    listen 80.89.234.203:443 ssl;
}
ты просто бог!
спасибо тебе большое человеческое!
можешь обьяснить мне, дураку, как ты так наколдавать смог? что именно сделал?))
 
Статус
В этой теме нельзя размещать новые ответы.
Современный облачный хостинг провайдер | Aéza
Назад
Сверху Снизу