1234567891011121314151617181920212223242526272829 |
- #worker_processes 1;
- pid /tmp/nginx.pid;
- error_log stderr error;
- events {
- worker_connections 16384;
- }
- http {
- resolver 127.0.0.1;
- access_log off;
- lua_package_path 'CWD/openresty/?.lua;;';
- init_by_lua 'encode = require("cjson").encode mysql = require("resty.mysql")';
- server {
- listen 8080;
- location /plaintext {
- default_type "text/plain";
- content_by_lua 'ngx.print("Hello, world!")';
- }
- location /json {
- default_type "application/json";
- content_by_lua 'ngx.print(encode({message = "Hello, World!"}))';
- }
- location / {
- content_by_lua 'require("app")(ngx)';
- }
- }
- }
|