ЧПУ

ЧПУ 1.2.0

Нет прав для скачивания

Protektor

Пользователь
у меня так было
Код:
location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass 127.0.0.1:9001;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $request_filename;
            fastcgi_param PHP_VALUE "date.timezone = Europe/Moscow";
        include /etc/nginx/fastcgi_params;
    }
        
    location /category {
         rewrite ^/category-(.*)-(.*).html /index.php?$2 last;
        }
        
    location /forum {
        rewrite ^/forum-(.*)-(.*).html /viewforum.php?$2 last;
        }
        
    location /topic {
        rewrite ^/topic-(.*)-(.*).html /viewtopic.php?$2 last;
        }
        
    location /profile {
        rewrite ^/profile-(.*)-(.*).html /profile.php?$2 last;
        }
попробуй
все location с реврайтами сразу после location ~ \.php$ прописать, у меня тоже такое было, после переноса все нормаль заработало.
 

Kryl

Пользователь
у меня так было
Код:
location ~ \.php$ {
        try_files $uri =404;
        fastcgi_pass 127.0.0.1:9001;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $request_filename;
            fastcgi_param PHP_VALUE "date.timezone = Europe/Moscow";
        include /etc/nginx/fastcgi_params;
    }
       
    location /category {
         rewrite ^/category-(.*)-(.*).html /index.php?$2 last;
        }
       
    location /forum {
        rewrite ^/forum-(.*)-(.*).html /viewforum.php?$2 last;
        }
       
    location /topic {
        rewrite ^/topic-(.*)-(.*).html /viewtopic.php?$2 last;
        }
       
    location /profile {
        rewrite ^/profile-(.*)-(.*).html /profile.php?$2 last;
        }
попробуй
все location с реврайтами сразу после location ~ \.php$ прописать, у меня тоже такое было, после переноса все нормаль заработало.
Не помогло , все равно скачивается профиль (
 

Kryl

Пользователь
Написал бы, как решил ;)
Вынес правила rewrite в файл /etc/nginx/vhosts-resources/rewrite.conf , но не все , профиль остался в гонфиге нигса
PHP:
    location / {
                location /profile {
                        rewrite ^/profile-(.*)-(.*).html /profile.php?$2 ;
                }
        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";
        fastcgi_pass unix:/var/www/php-fpm/kryl.sock;
        fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
        try_files $uri =404;
        include fastcgi_params;
    }
 
Сверху