123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- user www-data;
- worker_processes auto;
- error_log stderr error;
- #worker_rlimit_nofile 100000;
- #timer_resolution 1000ms;
- daemon off;
- events {
- worker_connections 65536;
- multi_accept off;
- }
- http {
- include /etc/nginx/mime.types;
- access_log off;
- server_tokens off;
- sendfile off;
- tcp_nopush off;
- tcp_nodelay on;
- keepalive_timeout 65s;
- keepalive_disable none;
- keepalive_requests 10000;
- php_ini_path /deploy/conf/php.ini;
- init_worker_by_php '
- require "app.php";
- ';
- server {
- listen 8080 default_server reuseport;
- root /;
- index index.html;
- php_keepalive 256;
- location = /hello {
- content_by_php '
- ngx_header_set("Content-Type", "text/plain");
- echo "Hello, World!";
- ';
- }
- location = /json {
- content_by_php '
- ngx_header_set("Content-Type", "application/json");
- echo json_encode(["message" => "Hello, World!"]);
- ';
- }
-
- location = /fortune {
- content_by_php '
- fortune();
- ';
- }
- location = /db {
- content_by_php '
- db();
- ';
- }
- location /query {
- content_by_php '
- query();
- ';
- }
- location /update {
- content_by_php '
- update();
- ';
- }
- # location = /info {
- # add_header Content-Type text/html;
- # content_by_php '
- # phpinfo();
- # ';
- # }
- }
- }
|