1.安装VScode 2.使用VScode nginx-format扩展工具 3.在打开的nginx.conf文件上右击,选择Format Document With,再选nginx-format,可以看到配置文件已经自动美化。