My website is hosted on 6-cylinder.com and I decided to add a wordpress blog which is in a completely different VPS. So, I used proxy to list my blog as a subdirectory of my main domain So the final product should be 6-cylinder.com/blog
The proxy is working completely fine except for one file only!!!!!
wp-admin/ajax.php
This is the error message in chrome console

Here is what I added to my wp-config.php
$_SERVER['REQUEST_URI'] = str_replace("/wp-admin/", "/blog/wp-admin/", $_SERVER['REQUEST_URI']);
define( 'WP_SITEURL', 'http://6-cylinder.com/blog' );
define( 'WP_HOME', 'http://6-cylinder.com/blog' );
and here is the proxy code in the nginx file
location ^~ /blog/ {
proxy_pass http://139.59.211.216/;
proxy_set_header X-Original-Host $host;
proxy_set_header X-Is-Reverse-Proxy "true";
proxy_pass_header Set-Cookie;
proxy_cookie_path / /blog/;
}
http://139.59.211.216/blog/and avoid all of the rewriting between/and/blog/?