0

I'm working on a client's fresh install and server. Every time I attempt to save a post or page, I'm immediately sent a connection reset error (This webpage is not available - ERR_CONNECTION_RESET). admin-ajax.php is also triggering a connection reset when autosaving drafts.

This install is unremarkable (WP 4.2.2, 2015 Theme, no plugins active) and is on a very capable machine: 2 CPU / 32 gb ram.

The only thing that is out of the ordinary is that it is behind a SSL load balancer that isn't reporting SSL to Apache. I added $_SERVER['HTTPS']='on' to wp-config.php manually to avoid mixed content errors when serving JS/CSS resources.

I've checked the logs and tried a number of things but I'm at my wit's end.

2 Answers 2

0

If you are running mod_security or anything like that would be first thing to check.

Security modules are server are known to react badly to WP's POST requests. That is consistent with circumstances you describe (post saves, Ajax).

2
0

For anyone who runs into this type of issue in the future, the firewall in the data center was blocking the requests. I'm not sure of the exact actions taken by the data center staff, but they were able to whitelist the site.

I was able to work around the issue as well by changing the location of the wp-admin folder (which is not a great idea, but if you had to...)

First, I added the following lines to the wp-config.php file:

define('WP_ADMIN_DIR', 'nu-admin');
define('ADMIN_COOKIE_PATH', SITECOOKIEPATH . WP_ADMIN_DIR);

In a plugin / theme / whatever, add the following lines:

add_filter('site_url',  'wpadmin_filter', 10, 3);
function wpadmin_filter( $url, $path, $orig_scheme ) {
    $old  = array( "/(wp-admin)/");
    $admin_dir = WP_ADMIN_DIR;
    $new  = array($admin_dir);
    return preg_replace( $old, $new, $url, 1);
}

Finally, in .htaccess I added the following rewrite

RewriteRule ^nu-admin/(.*) wp-admin/$1?%{QUERY_STRING} [L]

Hope it helps someone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.