我目前拥有的:
server {
listen 80;
server_name www.lala.com lala.com;
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:81;
}
}
我想向server_name
指令添加(而不是替换)一个新值。我尝试使用augtool
:
augtool> set /files/etc/nginx/conf.d/site.conf/server[1]/*[self::directive="server_name"]/arg[last() + 1] "www.lala2.com lala2.com"
error: Failed to execute command
Setting /files/etc/nginx/conf.d/site.conf/server[1]/*[self::directive="server_name"]/arg[last() + 1] failed
augtool>
使用 :
augtool> print /augeas//error
没有给我任何有关错误的线索。有人可以帮我吗?