nginx_php.conf 1.5 KB

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