Check if charset is defined

Check if charset is defined in http section, currently if choose charset to "none", the code add **charset** option without value, and nginx service fail.

According http://nginx.org/en/docs/http/ngx_http_charset_module.html
This commit is contained in:
Carlos Cesario
2018-11-30 09:02:13 -02:00
committed by GitHub
parent 94c0467d80
commit 8bbc261cdc
@@ -86,7 +86,9 @@ server {
sendfile {% if server.sendfile is defined and server.sendfile == '1' %}On{% else %}Off{% endif %};
{% endif %}
server_name {{ server.servername.replace(',', ' ') }};
{% if server.charset is defined %}
charset {{ server.charset }};
{% endif %}
access_log /var/log/nginx/{{ server.servername }}.access.log {{ server.access_log_format }};
error_log /var/log/nginx/{{ server.servername }}.error.log;
{% if server.root is defined and server.root != '' %}