diff --git a/src/nginxconfig/generators/conf/wordpress.conf.js b/src/nginxconfig/generators/conf/wordpress.conf.js index 3e3ab5b..5aabb4a 100644 --- a/src/nginxconfig/generators/conf/wordpress.conf.js +++ b/src/nginxconfig/generators/conf/wordpress.conf.js @@ -32,6 +32,9 @@ export default global => { deny: 'all', }; + config['# WordPress: SEO plugin'] = ''; + config['location ~* ^/wp-content/plugins/wordpress-seo(?:-premium)?/css/main-sitemap\\.xsl$'] = {}; + config['# WordPress: deny wp-content/plugins (except earlier rules)'] = ''; config['location ~ ^/wp-content/plugins'] = { deny: 'all', diff --git a/src/nginxconfig/generators/to_conf.js b/src/nginxconfig/generators/to_conf.js index d2c1bb9..3a3dcc8 100644 --- a/src/nginxconfig/generators/to_conf.js +++ b/src/nginxconfig/generators/to_conf.js @@ -107,7 +107,9 @@ export default entriesOrObject => { // Single linebreak between comment and block .replace(/^([^\S\r\n]*#.*)(?:\n[^\S\r\n]*)+\n([^\S\r\n]*.*{)/gm, '$1\n$2') // Double linebreak after double comment - .replace(/^([^\S\r\n]*#.*\n[^\S\r\n]*#.*\n)([^\S\r\n]*[^#\s])/gm, '$1\n$2'); + .replace(/^([^\S\r\n]*#.*\n[^\S\r\n]*#.*\n)([^\S\r\n]*[^#\s])/gm, '$1\n$2') + // No newline for empty blocks + .replace(/^([^\S\r\n]*.*{)\n[^\S\r\n]*(})/gm, '$1$2'); // Cleanup extra linebreaks between multiple close blocks // Use a loop as this has overlapping matches