nginx.conf 740 B

12345678910111213141516171819202122232425262728
  1. pid /tmp/nginx.pid;
  2. error_log stderr error;
  3. events {
  4. worker_connections 16384;
  5. }
  6. http {
  7. resolver 127.0.0.1;
  8. access_log off;
  9. lua_package_path 'CWD/?.lua;;';
  10. init_by_lua 'jit.opt.start("minstitch=10"); require "resty.core" encode = require("cjson").encode mysql = require("resty.mysql")';
  11. server {
  12. listen 8080;
  13. location /plaintext {
  14. default_type "text/plain";
  15. content_by_lua 'ngx.print("Hello, world!")';
  16. }
  17. location /json {
  18. default_type "application/json";
  19. content_by_lua 'ngx.print(encode({message = "Hello, World!"}))';
  20. }
  21. location / {
  22. content_by_lua 'require("app")(ngx)';
  23. }
  24. }
  25. }