nginx_php.conf 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. server_name localhost;
  22. root /;
  23. index index.html;
  24. location = /hello {
  25. add_header Content-Type text/plain;
  26. content_by_php '
  27. echo "Hello, World!";
  28. ';
  29. }
  30. location = /json {
  31. add_header Content-Type application/json;
  32. content_by_php '
  33. echo json_encode(["message" => "Hello, World!"]);
  34. ';
  35. }
  36. location = /fortune {
  37. add_header Content-Type "text/html; charset=UTF-8";
  38. content_by_php '
  39. include "fortune.php";
  40. ';
  41. }
  42. location /dbraw {
  43. add_header Content-Type application/json;
  44. content_by_php '
  45. $_GET = ngx::query_args();
  46. include "dbraw.php";
  47. ';
  48. }
  49. location /update {
  50. add_header Content-Type application/json;
  51. content_by_php '
  52. $_GET = ngx::query_args();
  53. include "updateraw.php";
  54. ';
  55. }
  56. }
  57. }