From 9c756aa2724930f52dcf643fd06bcefe8c37c883 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 10 Feb 2020 15:29:10 +0100 Subject: [PATCH] Fix the nginx virtualhost and the path of the wp command. --- tasks/wp_maintenance.yml | 4 ++-- templates/nginx_wordpress.conf.j2 | 5 +---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tasks/wp_maintenance.yml b/tasks/wp_maintenance.yml index 97429fe..faa21d1 100644 --- a/tasks/wp_maintenance.yml +++ b/tasks/wp_maintenance.yml @@ -15,7 +15,7 @@ cron: name: "Update the Wordpress core" special_time: 'daily' - job: "cd {{ wordpress_doc_root }} && wp core update {% if wordpress_auto_upgrade_minor_only %} --minor{% endif %} > /var/log/wordpress_maintenance/wp_core_update.log 2>&1" + job: "cd {{ wordpress_doc_root }} && /usr/local/bin/wp core update {% if wordpress_auto_upgrade_minor_only %} --minor{% endif %} > /var/log/wordpress_maintenance/wp_core_update.log 2>&1" state: present user: '{{ wordpress_system_user }}' @@ -36,7 +36,7 @@ cron: name: "Update the Wordpress plugins" special_time: 'daily' - job: "cd {{ wordpress_doc_root }} && wp plugin update --all > /var/log/wordpress_maintenance/wp_plugins_update.log 2>&1" + job: "cd {{ wordpress_doc_root }} && /usr/local/bin/wp plugin update --all > /var/log/wordpress_maintenance/wp_plugins_update.log 2>&1" state: present user: '{{ wordpress_system_user }}' diff --git a/templates/nginx_wordpress.conf.j2 b/templates/nginx_wordpress.conf.j2 index 687265c..30fe34e 100644 --- a/templates/nginx_wordpress.conf.j2 +++ b/templates/nginx_wordpress.conf.j2 @@ -120,12 +120,9 @@ server { } location ~ \.php$ { - #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini - try_files $uri =404; + include fastcgi.conf; fastcgi_intercept_errors on; fastcgi_pass php; - fastcgi_param REMOTE_ADDR $remote_addr; - include fastcgi_params; } location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {