1. 测试代码写在/usr/local/openresty/nginx/conf/nginx.conf文件里 //新加location location /test{ //设置默认输入 default_type text/html; content_by_lua 'ngx.say("hello world ")'; } 2.重启nginx nginx -s reload