Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Настройка конфига nginx для Ocstore 3


Recommended Posts

Доброе утро! 

Столкнулся с проблемой при использовании связки nginx+fmp. Не работает ЧПУ вместе с nginx.

Без ЧПУ всё работает нормально а с ним всегда перенаправляет на главную.

Например ссылка 

при вводе её в строку браузера принимает такой параметр 

То есть по среди ссылки появляется параметр q=? и все ссылки перенаправляются на главную.  Кто может решить эту ошибку (бесплатно или за деньги) пишите в эту тему или в личку.

Link to comment
Share on other sites


2 минуты назад, ubuntu сказал:

Здравствуйте!

Файл конфигурации nginx хоть бы показали.

 

Спойлер


            server {
                                                        listen 185.235.218.241:80;                                             
        server_name  leocase.com.ua www.leocase.com.ua;
        root  /home/alex083/sites/public_html;
        
                

        
                    access_log /etc/nginx/vhost_logs/leocase.com.ua_access;
                            error_log /etc/nginx/vhost_logs/leocase.com.ua_error;
        
                            
                
                            
        
        
                
        location ~ /.well-known { allow all; }

        # location ~* robots.txt  { root /etc/nginx; }

        location ~ /\.ht {
        deny all;
        access_log off;
        log_not_found off;
        }

                    gzip on;
            gzip_disable "MSIE [1-6]\.(?!.*SV1)";
            gzip_comp_level 3;
            gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
        
        
                    location / {
                    
            
            root /home/alex083/sites/public_html;
                                        
                            index index.php index.html index.htm;
                                if (!-e $request_filename) {
                    rewrite ^(.+)$ /index.php?q=$1 last;
                    }
                        try_files $uri $uri/ @opencart;
                        }
                        location @opencart
  rewrite ^/(.+)$ /index.php?_route_=$1 last;
}
                            location ~ \.php$ {
        try_files $fastcgi_script_name =404;
            root                       /home/alex083/sites/public_html;
            #fastcgi_pass       localhost:9010;
            fastcgi_pass unix:/var/run/php-fpm/php73w-alex083.sock;
            include fastcgi_params;
            fastcgi_split_path_info                 ^(.+?\.php)(/.*)?$;
            fastcgi_index index.php;
            fastcgi_param   SCRIPT_FILENAME         /home/alex083/sites/public_html$fastcgi_script_name;
            fastcgi_param   PATH_TRANSLATED         /home/alex083/sites/public_html$fastcgi_script_name;

                fastcgi_buffers  8 32k;
            fastcgi_buffer_size  4k;
            fastcgi_busy_buffers_size  68k;
    
                fastcgi_connect_timeout 120;
            fastcgi_read_timeout 900;
            fastcgi_send_timeout 900;
        
                    fastcgi_cache off;
                fastcgi_cache_key "$request_method|$http_if_modified_since|$http_if_none_match|$host|$request_uri";
            fastcgi_cache_valid 200 10s;
            
                            limit_conn lfcgi 50;
            
            #fastcgi_param   SCRIPT_FILENAME         /sites/public_html$fastcgi_script_name;
            #fastcgi_param   PATH_TRANSLATED         /sites/public_html$fastcgi_script_name;

            set             $path_info              $fastcgi_path_info;
            fastcgi_param   PATH_INFO               $path_info;
                        }
        


                
        
        
        # error_page  404              /404.html;
        # location = /40x.html {
        # }
        # error_page   500 502 503 504  /50x.html;
        # location = /50x.html {
        # }
        }

 

Link to comment
Share on other sites


21 минуту назад, ubuntu сказал:

Похоже вот эта строка дает этот эффект

  rewrite ^(.+)$ /index.php?q=$1 last;

Спасибо, уже исправил всё работает.

Link to comment
Share on other sites


  • 1 year later...
25.06.2021 в 11:28, leocase сказал:
25.06.2021 в 11:05, ubuntu сказал:

Похоже вот эта строка дает этот эффект

  rewrite ^(.+)$ /index.php?q=$1 last;

Спасибо, уже исправил всё работает.

Добрый день!
У меня та же проблема.
Подскажите пожалуйста, как удалось решить этот вопрос?

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.