diff --git a/tasks/config.yml b/tasks/config.yml index 399307c..91be963 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -17,7 +17,8 @@ loop: - dos.conf - nginx.conf - - php.conf + - php-common.conf + - php-wordpress.conf - ssl.conf loop_control: loop_var: ng_conf_item diff --git a/templates/host.conf.j2 b/templates/host.conf.j2 index d50ce7c..9b345b3 100644 --- a/templates/host.conf.j2 +++ b/templates/host.conf.j2 @@ -43,7 +43,10 @@ server root {{ eff_path }}; {% if mode == 'php' or mode == 'wordpress' or mode == 'moodle' %} - include php.conf; + include php-common.conf; +{% if mode == 'wordpress' %} + include php-wordpress.conf; +{% endif %} {% elif mode == 'proxy' %} location / diff --git a/templates/php.conf.j2 b/templates/php-common.conf.j2 similarity index 83% rename from templates/php.conf.j2 rename to templates/php-common.conf.j2 index 7f1ddd3..50e0001 100644 --- a/templates/php.conf.j2 +++ b/templates/php-common.conf.j2 @@ -1,11 +1,5 @@ index index.php; -# wordpress-specific -if (!-e $request_filename) -{ - rewrite ^.*$ /index.php last; -} - location ~ [^/]\.php(/|$) { if (!-f $document_root$fastcgi_script_name) diff --git a/templates/php-wordpress.conf.j2 b/templates/php-wordpress.conf.j2 new file mode 100644 index 0000000..7cbd93e --- /dev/null +++ b/templates/php-wordpress.conf.j2 @@ -0,0 +1,5 @@ +# wordpress-specific +if (!-e $request_filename) +{ + rewrite ^.*$ /index.php last; +}