• Resolved c1chrisc1

    (@c1chrisc1)


    Hi,

    I’m having some issues with my WordPress setup. My server is using Nginx, Varnish, APC, and PHP-FPM. My permalinks all seem to work fine with the exception of previewing posts. For some odd reason, I get a 404 error page.

    Whenever I preview posts within WordPress it brings me to a link like: http://www.domain.com/?p=986&preview=true which comes up as Page Not Found. Yet for all my published posts, the permalinks seem to work fine. My blog is currently using the Post name (domain.com/sample-post/) permalink setting.

    Even when I change the permalinks to default I’m still available to view all the posts and pages in the default permalink setting(domain.com/?p=123). But still can’t preview posts…

    I do have the try files in my setup:
    try_files $uri $uri/ /index.php?q=$uri&$args;

    Any suggestions on what it could be?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try…

    try_files $uri $uri/ /index.php?$args;

    If that doesn’t solve the issue, either, then the preview requests don’t reach WordPress. The error log (from Nginx / Varnish) may provide a clue, though.

    If Varnish doesn’t listen on port 80, try removing / bypassing Varnish altogether.

    I hope this helps!

    Thread Starter c1chrisc1

    (@c1chrisc1)

    Thanks for the reply!

    I tried your try_files suggestion and unfortunately it still doesn’t work. I’ll try and remove Varnish and see if that solves it.

    Thread Starter c1chrisc1

    (@c1chrisc1)

    So I figured it out. It was my Varnish configuration that was giving me the problems. Once I fixed that, everything is working perfectly fine now.

    Thanks Pothi!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘NGINX: Can't Preview Posts (404 ERROR)’ is closed to new replies.