<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font face="Arial">Hello,</font></p>
<p>I tried to set the Charset of a virtual host like this:</p>
<p>server {<br>
root /var/www/mywebsite.com;<br>
<br>
...<br>
<br>
charset iso-8859-1;<br>
override_charset on;<br>
<br>
...<br>
<br>
location ~ \.php$ {<br>
include snippets/fastcgi-php.conf;<br>
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;<br>
charset iso-8859-1;<br>
override_charset on;<br>
<br>
}<br>
}<br>
</p>
<p>I have specified charset and overried_charset on both server and
location and yet, it was still sending headers in UTF-8.<br>
<br>
I had to modify the php.ini file from /etc/php/7.2/fpm/php.ini to
specify in it default_charset = "iso-8859-1".<br>
<br>
But I would like to let my php set to UTF-8 and specify on Nginx
only for only one virtual host iso-8859-1.<br>
<br>
On Apache we can do:<br>
<br>
<VirtualHost mywebsite.com:80><br>
...<br>
Header set Content-Type "text/html; charset=iso-8859-1"<br>
</VirtualHost><br>
<br>
How to do the same on Nginx?<br>
<br>
Thanks,</p>
<p>Vincent.<br>
</p>
</body>
</html>