Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apisix/cli/ngx_tpl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ http {
server_tokens off;

include mime.types;
charset utf-8;
charset {* http.charset *};

# error_page
error_page 500 @50x.html;
Expand Down
2 changes: 2 additions & 0 deletions conf/config-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ nginx_config: # config for render the template to generate n
keepalive_requests: 1000 # Sets the maximum number of requests that can be served through one keepalive connection.
# After the maximum number of requests is made, the connection is closed.
keepalive_timeout: 60s # Sets a timeout during which an idle keepalive connection to an upstream server will stay open.
charset: utf-8 # Adds the specified charset to the "Content-Type" response header field, see
# http://nginx.org/en/docs/http/ngx_http_charset_module.html#charset

etcd:
host: # it's possible to define multiple etcd hosts addresses of the same etcd cluster.
Expand Down
18 changes: 18 additions & 0 deletions t/cli/test_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -621,3 +621,21 @@ if ! grep "keepalive_timeout 6s;" conf/nginx.conf > /dev/null; then
fi

echo "passed: found the keepalive related parameter in nginx.conf"

# check the charset setting
git checkout conf/config.yaml

echo '
nginx_config:
http:
charset: gbk
' > conf/config.yaml

make init

if ! grep "charset gbk;" conf/nginx.conf > /dev/null; then
echo "failed: 'charset gbk;' not in nginx.conf"
exit 1
fi

echo "passed: found the 'charset gbk;' in nginx.conf"