Support » Plugins » NGINX: Can't Preview Posts (404 ERROR)

  • Resolved c1chrisc1



    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: 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 ( 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( 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?


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!

    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.

    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.