nginx 另类操作

Posted on Tue 20 March 2018 in 未分类

通过在配置里面写入返回内容,不需要读取文件(index.html)

返回 request headers 之类的也可以不需要额外的程序处理。

location block:

location / {
#return 204;
return 200 "<b> You just found me.</b> $http_x_forwarded_for";
add_header Content-Type text/html;
}

via source

另外 nginx 跟 O'Reilly 出了个 Cookbook.

The Complete NGINX Cookbook