diff --git a/frameworks/ngx-php/app.php b/frameworks/ngx-php/app.php index c53db4abe..1408e247a 100644 --- a/frameworks/ngx-php/app.php +++ b/frameworks/ngx-php/app.php @@ -6,15 +6,6 @@ Pgsql::init(); define('JSON_DATA', json_decode(file_get_contents('/data/dataset.json'), true)); -function guard() -{ - if (!in_array(ngx_request_method(), ['POST', 'GET'])) { - ngx_header_set('Content-Type', 'text/plain'); - echo 'Method Not Allowed'; - ngx::_exit(405); - } -} - function baseline() { $sum = array_sum(ngx::query_args()); diff --git a/frameworks/ngx-php/meta.json b/frameworks/ngx-php/meta.json index 4e0ae50ae..f8afd05dc 100644 --- a/frameworks/ngx-php/meta.json +++ b/frameworks/ngx-php/meta.json @@ -1,7 +1,7 @@ { "display_name": "ngx-php", "language": "PHP", - "type": "production", + "type": "tuned", "engine": "nginx", "description": "Embedded PHP scripting language module for nginx.", "repo": "https://github.com/rryqszq4/ngx-php", diff --git a/frameworks/ngx-php/nginx.conf b/frameworks/ngx-php/nginx.conf index be5a1e599..63576db31 100644 --- a/frameworks/ngx-php/nginx.conf +++ b/frameworks/ngx-php/nginx.conf @@ -17,6 +17,7 @@ http { server_tokens off; msie_padding off; etag off; + root /data; types { text/html html htm; @@ -66,28 +67,25 @@ http { init_worker_by_php 'require "app.php";'; - access_by_php 'guard();'; - server { - listen 8080 reuseport; + listen 8080 reuseport backlog=65536; location =/baseline11 { content_by_php 'baseline();'; } location =/pipeline { content_by_php 'pipeline();'; } - location =/upload { content_by_php 'upload();'; } location =/async-db { content_by_php 'asyncDb();'; } + location =/upload { content_by_php 'upload();'; } location /json/ { content_by_php 'json();'; } location /static/ { - autoindex on; - root /data; + #autoindex on; add_header Last-Modified ''; - gzip_static on; + #open_file_cache max=1000 inactive=5m; } } server { - listen 8081 ssl reuseport; + listen 8081 ssl reuseport backlog=65536; ssl_certificate /certs/server.crt; ssl_certificate_key /certs/server.key; @@ -99,7 +97,7 @@ http { } server { - listen 8443 ssl reuseport; + listen 8443 ssl reuseport backlog=65536; listen 8443 quic reuseport; http2 on; http3 on; @@ -117,9 +115,8 @@ http { location =/baseline2 { content_by_php 'baseline();'; } location /static/ { - root /data; add_header Last-Modified ''; - gzip_static on; + #open_file_cache max=1000 inactive=5m; } } }