HowTo: Nginx Webserver Send Charset utf-8 Under Unix / Linux

To send the charset utf-8 with Nginx web server under Unix / Linux, you need to add the following code to your Nginx configuration file:

http {
# ...
add_header 'Content-Type' 'text/html; charset=UTF-8';
# ...
}

You can add this code inside the http block of your Nginx configuration file. This header will be sent with every HTTP response generated by Nginx, indicating that the content is encoded as UTF-8.

After making the changes to the configuration file, you need to restart Nginx to apply the changes:

sudo service nginx restart

Leave a Comment