Clicky

Hospedado por Limestone Networks

Jump to content
  • Sign Up

Sign in to follow this  
alfaromeo145

Nginx gerando erro 404 apenas em um link

Recommended Posts

Pessoal, tenho um site com Nginx 1.10 e PHP FPM, este site está numa VPS com prestashop instalado.

Quando a reescrita de url está desativada no admin da prestashop tudo funciona corretamente.

Mas quando está ativada ele gera um erro apenas quando o cliente realiza a forma de pagamento via boleto/transferência bancária.

OBS: Quando usava apache + PHP funcionada com o modo rewrite normalmente.

Alguém poderia me ajudar ou indicar que possa? Pois já procurei um monte e não encontro nada que resolva.

Acredito que serja alguma regre de reescrita.

 

Segue a URL que ele tenta reescrever e minhas confg do nginx:

Ocultei algumas informações.

URL que ele tenta reescrever:

https://www.asdasdad.com.br/module/fkpagseguroct/index.php?controller=order-confirmation&id_cart=20&id_module=69&id_order=9&key=2de101ad29ae36c225fcb58e02732b0d&cod_status=1&cod_transacao=AE7A2E66-5169-4C76-9F61-F5CE9E74B405&link_boleto=https://pagseguro.uol.com.br/checkout/payment/booklet/print.jhtml?c=7348be634c88847921b4ef9ce6943e55f6bc50b58035c819ba4f36d93785da00da0746b69bdba55f&link_transf=

 

Config do Nginx

Ocultei algumas informações.

server {
    listen      132123131313.155:80;
    server_name emasdasds.com.br www.asdads.com.br;
    root        /home/admin/web/asdasd.com.br/public_html;
    index       index.php index.html index.htm;
    access_log  /var/log/nginx/domains/adsasdads.com.br.log combined;
    access_log  /var/log/nginx/domains/asdads.com.br.bytes bytes;
    error_log   /var/log/nginx/domains/asdads.com.br.error.log error;


  index index.php index.html;
 
  rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;
  rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$1$2.jpg last;
  rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3.jpg last;
  rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg last;
  rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg last;
  rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg last;
  rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last;
  rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8.jpg last;
  rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg last;
  rewrite ^/c/([0-9]+)(-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2.jpg last;
  rewrite ^/c/([a-zA-Z-]+)(-[0-9]+)?/.+\.jpg$ /img/c/$1.jpg last;
  rewrite ^/([0-9]+)(-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2.jpg last;
  try_files $uri $uri/ /index.php?$args;
  
    
    location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
            expires     max;
        }

        location ~ [^/]\.php(/|$) {
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            if (!-f $document_root$fastcgi_script_name) {
                return  404;
            }

            fastcgi_pass    127.0.0.1:9001;
            fastcgi_index   index.php;
            include         /etc/nginx/fastcgi_params;
        }
    

    error_page  403 /error/404.html;
    error_page  404 /error/404.html;
    error_page  500 502 503 504 /error/50x.html;

    location /error/ {
        alias   /home/admin/web/em4patas.com.br/document_errors/;
    }

    location ~* "/\.(htaccess|htpasswd)$" {
        deny    all;
        return  404;
        log_not_found off;
        access_log off;
    }

    location /vstats/ {
        alias   /home/admin/web/asdadsasd.com.br/stats/;
        include /home/admin/web/asdadsadsads.com.br/stats/auth.conf*;
    }

     location = /favicon.ico {
        log_not_found off;      # PrestaShop by default does not provide a favicon.ico
        access_log off;         # Disable logging to prevent excessive log sizes
    }
    
    location = /robots.txt {
         auth_basic off;        # Whatever happens, always let bots know about your policy
         allow all;
         log_not_found off;     # Prevent excessive log size
         access_log off;
    }
    
    include     /etc/nginx/conf.d/phpmyadmin.inc*;
    include     /etc/nginx/conf.d/phppgadmin.inc*;
    include     /etc/nginx/conf.d/webmail.inc*;

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...