nginx_php.conf 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. user www-data;
  2. worker_processes auto;
  3. error_log stderr error;
  4. worker_rlimit_nofile 200000;
  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. php_ini_path /deploy/conf/php.ini;
  19. server {
  20. listen 8080 reuseport;
  21. root /;
  22. index index.html;
  23. location = /hello {
  24. add_header Content-Type text/plain;
  25. content_by_php '
  26. echo "Hello, World!";
  27. ';
  28. }
  29. location = /json {
  30. add_header Content-Type application/json;
  31. content_by_php '
  32. echo json_encode(["message" => "Hello, World!"]);
  33. ';
  34. }
  35. location = /fortune {
  36. add_header Content-Type "text/html; charset=UTF-8";
  37. content_by_php '
  38. include "fortune.php";
  39. ';
  40. }
  41. location /dbraw {
  42. add_header Content-Type application/json;
  43. content_by_php '
  44. $_GET = ngx::query_args();
  45. include "dbraw.php";
  46. ';
  47. }
  48. location /update {
  49. add_header Content-Type application/json;
  50. content_by_php '
  51. $_GET = ngx::query_args();
  52. include "updateraw.php";
  53. ';
  54. }
  55. }
  56. }