我想在所有网站上都有这些规则。 我只是不知道该怎么做。
location = /favicon.ico { expires 168h; log_not_found off; access_log off; #return 404; } location = /robots.txt { expires 168h; log_not_found off; access_log off; } location = /someotherlocation.ext { log_not_found off; access_log off; }
我不认为这是可能的。
解决方法:将这些设置移动到单独的文件并将其包含在每个服务器中。
把它放在一个文件中,并将这个文件include在你的所有虚拟主机中。