Welcome to Centmin Mod Community
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

    108
    31
    28
    Nov 10, 2014
    Ratings:
    +37
    Local Time:
    8:03 AM
    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

    108
    31
    28
    Nov 10, 2014
    Ratings:
    +37
    Local Time:
    8:03 AM
    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

    53,190
    12,113
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,649
    Local Time:
    1:03 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    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
     
  4. Mask

    Mask Active Member

    108
    31
    28
    Nov 10, 2014
    Ratings:
    +37
    Local Time:
    8:03 AM
    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.