server-demo.conf 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. lua_code_cache on;
  2. client_max_body_size 5m;
  3. client_body_buffer_size 256k;
  4. lua_package_path "/opt/wolf/agent/lua/?.lua;;";
  5. error_log /dev/stderr info;
  6. server {
  7. listen 12182;
  8. server_name localhost;
  9. #EXTENSION_CONFIG
  10. location /wolf/rbac {
  11. proxy_set_header Host $host;
  12. proxy_set_header X-Real-IP $remote_addr;
  13. proxy_set_header REMOTE-HOST $remote_addr;
  14. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  15. proxy_set_header Accept-Encoding "";
  16. proxy_connect_timeout 10;
  17. proxy_send_timeout 10;
  18. proxy_read_timeout 10;
  19. proxy_buffer_size 256k;
  20. proxy_buffers 4 256k;
  21. proxy_busy_buffers_size 256k;
  22. proxy_temp_file_write_size 256k;
  23. proxy_max_temp_file_size 128m;
  24. proxy_pass http://127.0.0.1:12180;
  25. }
  26. # Clear the content-length of response
  27. header_filter_by_lua_file /opt/wolf/agent/lua/header_filter.lua;
  28. # filter, add infobar to the page
  29. body_filter_by_lua_file /opt/wolf/agent/lua/body_filter.lua;
  30. # proxy for application
  31. location / {
  32. # $appID,Must be an application ID that has been successfully added on the console
  33. set $appID unknow;
  34. # access check
  35. access_by_lua_file /opt/wolf/agent/lua/access_check.lua;
  36. #proxy_set_header Host $host;
  37. proxy_set_header X-Real-IP $remote_addr;
  38. proxy_set_header REMOTE-HOST $remote_addr;
  39. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  40. proxy_set_header Accept-Encoding "";
  41. proxy_connect_timeout 10;
  42. proxy_send_timeout 10;
  43. proxy_read_timeout 10;
  44. proxy_buffer_size 256k;
  45. proxy_buffers 4 256k;
  46. proxy_busy_buffers_size 256k;
  47. proxy_temp_file_write_size 256k;
  48. proxy_max_temp_file_size 128m;
  49. # for test only
  50. proxy_ssl_verify off;
  51. # really url for the application
  52. proxy_pass http://127.0.0.1:12184;
  53. }
  54. }