mirror of
https://github.com/geerlingguy/ansible-role-nginx.git
synced 2024-11-13 10:14:20 +01:00
Fix unnatural indentation in extra_parameters block
Previously, one needed to extra-indent subsequent lines by 4 spaces. This changes makes reading the configuration in yaml much more pleasant.
This commit is contained in:
parent
3f11a46b50
commit
0d399a67a7
15
README.md
15
README.md
@ -28,17 +28,16 @@ A list of vhost definitions (server blocks) for Nginx virtual hosts. If left emp
|
|||||||
error_log: ""
|
error_log: ""
|
||||||
extra_parameters: |
|
extra_parameters: |
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
}
|
}
|
||||||
|
|
||||||
An example of a fully-populated nginx_vhosts entry, using a `|` to declare a block of syntax for the `extra_parameters`.
|
An example of a fully-populated nginx_vhosts entry, using a `|` to declare a block of syntax for the `extra_parameters`.
|
||||||
|
|
||||||
Please take note of the indentation in the above block. The first line should be a normal 2-space indent, with everything else 4-space indented, relative to the first line.
|
Please take note of the indentation in the above block. The first line should be a normal 2-space indent. All other lines should be indented normally relative to that line. In the generated file, the entire block will be 4-space indented. This style will ensure the config file is indented correctly.
|
||||||
Following this style will ensure the config file is indented correctly.
|
|
||||||
|
|
||||||
nginx_remove_default_vhost: false
|
nginx_remove_default_vhost: false
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ server {
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if vhost.extra_parameters is defined %}
|
{% if vhost.extra_parameters is defined %}
|
||||||
{{ vhost.extra_parameters }}
|
{{ vhost.extra_parameters|indent(4) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
}
|
}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user