nginx.conf 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. worker_processes auto;
  2. # pid /tmp/nginx.pid;
  3. error_log stderr crit;
  4. #error_log /tmp/test.log error;
  5. env LAPIS_ENVIRONMENT;
  6. daemon off;
  7. events {
  8. worker_connections 16384;
  9. }
  10. http {
  11. variables_hash_max_size 1024;
  12. access_log off;
  13. include mime.types;
  14. lua_package_path 'CWD/?.lua;;';
  15. upstream database {
  16. postgres_server DBHOSTNAME dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass;
  17. }
  18. init_by_lua 'require "resty.core"; lapis = require "lapis.init"';
  19. server {
  20. listen 8080;
  21. lua_code_cache on;
  22. charset "utf-8";
  23. location / {
  24. default_type text/html;
  25. set $_url "";
  26. content_by_lua_file "loader.lua";
  27. }
  28. location /static/ {
  29. alias static/;
  30. }
  31. location /favicon.ico {
  32. alias static/favicon.ico;
  33. }
  34. location = /query {
  35. internal;
  36. postgres_pass database;
  37. postgres_query $echo_request_body;
  38. }
  39. }
  40. }