nginx_php.conf 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. $_GET = ngx::query_args();
  48. include "dbraw.php";
  49. ';
  50. }
  51. location /update {
  52. add_header Content-Type application/json;
  53. content_by_php '
  54. $_GET = ngx::query_args();
  55. include "updateraw.php";
  56. ';
  57. }
  58. }
  59. }