nginx_plain_php.conf 2.0 KB

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