nginx_php.conf 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. user www-data;
  2. worker_processes auto;
  3. error_log stderr error;
  4. #worker_rlimit_nofile 100000;
  5. timer_resolution 1000ms;
  6. daemon off;
  7. events {
  8. worker_connections 16384;
  9. multi_accept off;
  10. }
  11. http {
  12. include /etc/nginx/mime.types;
  13. access_log off;
  14. server_tokens off;
  15. sendfile off;
  16. tcp_nopush off;
  17. tcp_nodelay on;
  18. keepalive_timeout 65s;
  19. keepalive_disable none;
  20. keepalive_requests 1000;
  21. php_ini_path /deploy/conf/php.ini;
  22. server {
  23. listen 8080 reuseport;
  24. root /;
  25. index index.html;
  26. location = /hello {
  27. add_header Content-Type text/plain;
  28. content_by_php '
  29. echo "Hello, World!";
  30. ';
  31. }
  32. location = /json {
  33. add_header Content-Type application/json;
  34. content_by_php '
  35. echo json_encode(["message" => "Hello, World!"]);
  36. ';
  37. }
  38. location = /fortune {
  39. add_header Content-Type "text/html; charset=UTF-8";
  40. content_by_php '
  41. include "fortune.php";
  42. ';
  43. }
  44. location = /dbraw {
  45. add_header Content-Type application/json;
  46. content_by_php '
  47. include "dbraw.php";
  48. ';
  49. }
  50. location /dbquery {
  51. add_header Content-Type application/json;
  52. content_by_php '
  53. $_GET = ngx::query_args();
  54. include "dbquery.php";
  55. ';
  56. }
  57. location /update {
  58. add_header Content-Type application/json;
  59. content_by_php '
  60. $_GET = ngx::query_args();
  61. include "updateraw.php";
  62. ';
  63. }
  64. }
  65. }