• Resolved ppp0

    (@ppp0)


    It’s weird that I get a 404 error (error from NGINX, not from WordPress) when I click Add to Cart from Chrome browser.

    But the website works fine with Firefox.

    I suspect it’s a NGINX configuration issue because the 404 shown does not appear with WordPress headers, etc. So I don’t think it is a permalink config issue? I tried changing the permalink but got the WordPress’s version of the 404 errors (with headers, etc)

    However feel free to prove me wrong.

    What else should I be looking at?

    This is the 404 line from /var/log:

    – – [21/Aug/2019:12:47:01 +0800] “POST /product/bebesup-sensitive-travel-pack-20-sheet-x-12-pack/ HTTP/2.0” 404 180 “https://www.bebesup.my/product/bebesup-sensitive-travel-pack-20-sheet-x-12-pack/” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36”

    And the related nginx config:

    location / {
    set $cors “”;
    if ($http_origin ~* ‘https?://(www\.bebesup\.my|bebesup\.my)’) {
    set $cors “true”;
    }
    if ($cors = ‘true’) {
    add_header ‘Access-Control-Allow-Origin’ “$http_origin”;
    }
    add_header Strict-Transport-Security “max-age=31536000; includeSubDomains”;
    try_files $uri $uri/ /index.php?q=$uri&$args;
    root /xxx/xxx/www/bebesup.my;
    # index index.php index.html index.htm;
    }

    location ~ \.php$ {
    set $cors “”;=
    if ($http_origin ~* ‘https?://(www\.bebesup\.my|bebesup\.my)’) {
    set $cors “true”;
    }
    if ($cors = ‘true’) {
    add_header ‘Access-Control-Allow-Origin’ “$http_origin”;
    }
    add_header Strict-Transport-Security “max-age=31536000; includeSubDomains”;
    fastcgi_buffer_size 4K;
    fastcgi_buffers 64 4k;
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_read_timeout 120;
    fastcgi_pass unix:/var/run/php-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $request_filename;
    include fastcgi_params;
    }
    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
    root /xxx/xxx/www/nginx-dist;
    }
    location ~ ^/\.user\.ini {
    deny all;
    }
    Thank you.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘404 Error when Add To Cart on Chrome (but no issue on FF)’ is closed to new replies.