WordPress post-name permalink redirects to site.com

Try separating the second location block:

location /blog { alias /var/www/wordpress-site/; try_files $uri $uri/ /blog/index.php?$args; }

location ~ \.php$ { fastcgi_split_path_info ^(/blog)(/.*)$; include snippets/fastcgi-php.conf; include fastcgi_params; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; fastcgi_param SCRIPT_FILENAME $request_filename; }

Hope this helps!

error code: 523