nginx error [emerg]: unknown directive “锘? in E:\nginx-1.18.0/conf/nginx.conf:3

Error reported :nginx 报错[emerg] 32408#14080: unknown directive "锘? in E:\nginx-1.18.0/conf/nginx.conf:3

Reason : 使用nginx服务时,用txt记事本打开编辑了nginx.conf文件When software such as Notepad that comes with Windows saves a file encoded in UTF-8, three invisible characters (0xEF 0xBB 0xBF, or BOM) will be inserted at the beginning of the file. It is a string of hidden characters used to let editors such as Notepad identify whether the file is encoded in UTF-8.

Solution :

  1. Copy nginx.confthe file contents, create a new one nginx.conf, and delete the previous one.
  2. Then select Open with, VSCode, webStrom, and other editors to reopen nginx.confthe file.
    Insert image description here
  3. Restart nginx

Supongo que te gusta

Origin blog.csdn.net/jieyucx/article/details/133082053
Recomendado
Clasificación