XF 2.0 Чпу в связке с FastCGI (Nginx + PHP-FPM)

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

dimazhlby

Проверенные
Сообщения
38
Реакции
8
Баллы
145
Привет всем, включил ЧПУ на форуме, ошибка 404 в темах. Как сделать, чтобы чпу работало в FastCGI (Nginx + PHP-FPM)? В апаче работает без проблем
 
Покажи свой конфиг домена в nginx

Конфиг
server {
server_name teldery.info www.teldery.info;
charset off;
index index.php index.html;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/teldery.info/*.conf;
access_log /var/www/httpd-logs/teldery.info.access.log;
error_log /var/www/httpd-logs/teldery.info.error.log notice;
ssi on;
set $root_path /var/www/dimazhl/data/www/teldery.info;
root $root_path;
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 7d;
try_files $uri $uri/
@fallback;
}
}
return 301 https://$host:443$request_uri;
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;
listen 185.189.15.58:80;
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/dimazhl.sock;
fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
try_files $uri =404;
include fastcgi_params;
}
}
server {
server_name teldery.info www.teldery.info;
ssl_certificate "/var/www/httpd-cert/dimazhl/teldery.info_le2.crtca";
ssl_certificate_key "/var/www/httpd-cert/dimazhl/teldery.info_le2.key";
ssl_ciphers EECDH:+AES256:-3DES:RSA+AES:!NULL:!RC4;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_dhparam /etc/ssl/certs/dhparam4096.pem;
charset off;
index index.php index.html;
disable_symlinks if_not_owner from=$root_path;
include /etc/nginx/vhosts-includes/*.conf;
include /etc/nginx/vhosts-resources/teldery.info/*.conf;
access_log /var/www/httpd-logs/teldery.info.access.log;
error_log /var/www/httpd-logs/teldery.info.error.log notice;
ssi on;
set $root_path /var/www/dimazhl/data/www/teldery.info;
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 7d;
try_files $uri $uri/
@fallback;
}
}
add_header Strict-Transport-Security "max-age=31536000;";
listen 185.189.15.58:443 ssl;
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/dimazhl.sock;
fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
try_files $uri =404;
include fastcgi_params;
}
}
 
99491

Все работает. Минимум для счастливой жизни
Код:
server {
    listen      1.1.1.1 ssl http2;
    server_name domain.net www.domain.net;
    root        /home/blabla/public_html;
    index       index.php index.html index.htm;
    access_log  /var/log/nginx/domains/domain.net.bytes bytes;
    error_log   /var/log/nginx/domains/domain.net.error.log error;
    ssl_certificate      /home/blabla/ssl.domain.net.pem;
    ssl_certificate_key  /home/blabla/ssl.domain.net.key;

    location / {
                try_files $uri $uri/ /index.php?$uri&$args;
        }

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

    location ~ \.php$ {
        try_files $uri = 404;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass    unix:/var/run/php-domain.net.sock;
        fastcgi_index   index.php;
        include         /etc/nginx/fastcgi_params;

        }

}
 
Посмотреть вложение 99491

Все работает. Минимум для счастливой жизни
Код:
server {
    listen      1.1.1.1 ssl http2;
    server_name domain.net www.domain.net;
    root        /home/blabla/public_html;
    index       index.php index.html index.htm;
    access_log  /var/log/nginx/domains/domain.net.bytes bytes;
    error_log   /var/log/nginx/domains/domain.net.error.log error;
    ssl_certificate      /home/blabla/ssl.domain.net.pem;
    ssl_certificate_key  /home/blabla/ssl.domain.net.key;

    location / {
                try_files $uri $uri/ /index.php?$uri&$args;
        }

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

    location ~ \.php$ {
        try_files $uri = 404;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass    unix:/var/run/php-domain.net.sock;
        fastcgi_index   index.php;
        include         /etc/nginx/fastcgi_params;

        }

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