nginx.conf 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. worker_processes auto;
  2. # pid /tmp/nginx.pid;
  3. error_log stderr notice;
  4. #error_log /tmp/test.log error;
  5. env LAPIS_ENVIRONMENT;
  6. env DBHOST;
  7. daemon off;
  8. events {
  9. worker_connections 16384;
  10. }
  11. http {
  12. variables_hash_max_size 1024;
  13. access_log off;
  14. include mime.types;
  15. lua_package_path 'CWD/?.lua;;';
  16. upstream database {
  17. postgres_server TFB-database dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass;
  18. }
  19. init_by_lua 'require "resty.core"; lapis = require "lapis.init"';
  20. server {
  21. listen 8080;
  22. lua_code_cache on;
  23. charset "utf-8";
  24. location / {
  25. default_type text/html;
  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. }