nginx.conf 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. upstream database {
  15. postgres_server DBHOSTNAME dbname=hello_world user=benchmarkdbuser password=benchmarkdbpass;
  16. }
  17. init_by_lua 'require "resty.core"; lapis = require "lapis.init"';
  18. server {
  19. listen 8080;
  20. lua_code_cache on;
  21. charset "utf-8";
  22. location / {
  23. default_type text/html;
  24. set $_url "";
  25. content_by_lua_file "loader.lua";
  26. }
  27. location /static/ {
  28. alias static/;
  29. }
  30. location /favicon.ico {
  31. alias static/favicon.ico;
  32. }
  33. location = /query {
  34. internal;
  35. postgres_pass database;
  36. postgres_query $echo_request_body;
  37. }
  38. }
  39. }