Learn about Centmin Mod LEMP Stack today
Become a Member

Nginx Strange rewrite/nginx issue

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Mask, Dec 6, 2014.

Tags:
  1. Mask

    Mask Active Member

    104
    29
    28
    Nov 10, 2014
    Ratings:
    +35
    Local Time:
    9:22 PM
    Nginx 1.9.1
    MariaDB 10.0.19
    Hi guys,

    I have tried everything and looking for any possible answer but I am lost .. please help me here.
    This is my 2nd CentminMod install ... Currently using Standard setup + fastcgi_cache + ngx_pagespeed. (Everything is done following guides here and forum)
    Site is working fine but I am randomly getting issue with rewrite. The browser will show 404 Not found error and the log will show
    Code:
    2014/12/06 11:17:45 [error] 15989#0: *22 "/home/nginx/domains/domain.com/public/2012/10/31/my-old-post-title/index.php" is not found (2: No such file or directory), client: x.x.x.x, server: domain.com, request: "GET /2012/10/31/my-old-post-title/ HTTP/1.1", host: "domain.com"
    
    My permalink settings are
    Code:
    Custom Structure: http://domain.com/ %year%/%monthnum%/%day%/%postname%/
    The site is running WordPress and forum but the issue is happening with just WP.

    I may be going out of my mind but I think it's happening more when using Chrome ... Less with FireFox. And it will not happen on all posts. Sometime same blog post will work fine, and then give the above error. :(

    Please help me, what to do, where to start looking?
    Domain config file attached.
     

    Attached Files:

  2. Mask

    Mask Active Member

    104
    29
    28
    Nov 10, 2014
    Ratings:
    +35
    Local Time:
    9:22 PM
    Nginx 1.9.1
    MariaDB 10.0.19
    Tried to enable debug for error log.

    Code:
    2014/12/06 11:51:46 [notice] 16178#0: *180 "/wp-admin$" does not match "/2014/03/31/mobile-users-start-experiencing-3g/", client: x.x.x.x, server: domain.com, request: "GET /2014/03/31/mobile-users-start-experiencing-3g/?cf_action=sync_comments&post_id=49937 HTTP/1.1", host: "domain.com", referrer: "http://domain.com/2014/03/31/mobile-users-start-experiencing-3g/"
    2014/12/06 11:51:46 [debug] 16178#0: *180 Passing on content handling for non-pagespeed resource 'http://domain.com/2014/03/31/mobile-users-start-experiencing-3g/?cf_action=sync_comments&post_id=49937'
    2014/12/06 11:51:46 [error] 16178#0: *180 "/home/nginx/domains/domain.com/public/2014/03/31/mobile-users-start-experiencing-3g/index.php" is not found (2: No such file or directory), client: x.x.x.x, server: domain.com, request: "GET /2014/03/31/mobile-users-start-experiencing-3g/?cf_action=sync_comments&post_id=49937 HTTP/1.1", host: "domain.com", referrer: "http://domain.com/2014/03/31/mobile-users-start-experiencing-3g/"
    
    I can't get why it's adding an extra "index.php" after URL.
     
  3. eva2000

    eva2000 Administrator Staff Member

    30,164
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    2:22 AM
    Nginx 1.13.x
    MariaDB 5.5
    Unfortunately, you're on your own for diagnose WP issues.. could be the longer permalinks ? I don't have such issues with my normal permalink format which is either postid or postid/postname

    my blog at Centmin Mod Blog | Menu based Nginx auto installer script uses fastcgi_cache and Centmin Mod LEMP fine

    my blog at wordpress7.centminmod.com - Centmin Mod LEMP stack Wordpress Auto Installer on CentOS 7.0 uses super cache plugin and Centmin Mod LEMP fine

    for less problems, super cache plugin > fastcgi_cache
     
    • Like Like x 1
  4. Mask

    Mask Active Member

    104
    29
    28
    Nov 10, 2014
    Ratings:
    +35
    Local Time:
    9:22 PM
    Nginx 1.9.1
    MariaDB 10.0.19
    I have two CentminMod installs and this is happening with just this one server. I m guessing it may be something with the theme (it's a custom one) or with some plugin. It's really a strange one.

    And the kinda tricky odd part, when I am using Chrome I see 404 error page.
    When I am using FireFox, page works fine. (even when there is log entry in error logs)

    I am just clueless about it. I thought I will post here in case someone else experienced a similar issue.