I know this is old, but for those still finding this in search engines, thats not the 'correct' fix, though it could work, The problem us using a root path inside of the location block, if you move the root outside of location and into the server { } block, then there is no need to have a duplicated nested php block, nor is there a need to manually define the document root since $document_root wouby kblessinggr - Nginx Mailing List - English
location / { rewrite ^/cat([0-9]+)\.html$ /index.php?c=$1 last; rewrite ^/forum([0-9]+)-([0-9]+)\.html$ /viewforum.php?f=$1&start=$2 last; rewrite ^/forum([0-9]+)\.html$ /viewforum.php?f=$1 last; rewrite ^/topic([0-9]+)-([0-9]+)\.html$ /viewtopic.php?t=$1&start=$2 last; rewrite ^/topic([0-9]+)\.html$ /viewtopic.php?t=$1 last; rewrite ^/post([0-9]+)\.html$ /viewtopic.php?p=$1 last;by kblessinggr - Migration from Other Servers