Browse Source

Optimize nginx.conf (#4292)

* Optimize nginx.conf

* Optimize php-ngx  conf

* Multi accept off in nginx.conf
Joan Miquel 6 years ago
parent
commit
ceda9bcd5e

+ 1 - 1
frameworks/C/nginx/benchmark_config.json

@@ -3,7 +3,7 @@
   "tests": [
     {
       "default": {
-        "plaintext_url": "/hello",
+        "plaintext_url": "/",
         "port": 8080,
         "approach": "Realistic",
         "classification": "Platform",

+ 2 - 8
frameworks/C/nginx/nginx.conf

@@ -7,12 +7,11 @@ daemon off;
 
 events {
     worker_connections 32768;
-	multi_accept on;
+	multi_accept off;
 }
 
 http {
     include       /etc/nginx/mime.types;
-    default_type  application/octet-stream;
     access_log off;
     server_tokens off;
 
@@ -26,12 +25,7 @@ http {
 
         root /;
         
-        location / {
-            root   html;
-            index  index.html index.htm;
-        }
-
-        location /hello {
+        location = / {
             default_type text/plain;
             return 200 "Hello, World!";
         }

+ 11 - 11
frameworks/PHP/php/deploy/nginx_php.conf

@@ -33,32 +33,32 @@ http {
         root /;
         index  index.html;
 
-        location /hello {
+        location = /hello {
 	        add_header Content-Type text/plain;
             content_by_php '
                 echo "Hello, World!";
             ';
         }
 
-        location /json {
+        location = /json {
             add_header Content-Type application/json;
             content_by_php '
                 echo json_encode(["message" => "Hello, World!"]);
             ';
         }
-
-        location /dbraw {
-            add_header Content-Type application/json;
+        
+        location = /fortune {
+            add_header Content-Type "text/html; charset=UTF-8";
 	        content_by_php '
-                $_GET = ngx::query_args();
-                include "/dbraw.php";
+                include "fortune.php";
             ';
         }
 
-        location /fortune {
-            add_header Content-Type "text/html; charset=UTF-8";
+        location /dbraw {
+            add_header Content-Type application/json;
 	        content_by_php '
-                include "/fortune.php";
+                $_GET = ngx::query_args();
+                include "dbraw.php";
             ';
         }
 
@@ -66,7 +66,7 @@ http {
             add_header Content-Type application/json;
 	        content_by_php '
                 $_GET = ngx::query_args();
-                include "/updateraw.php";
+                include "updateraw.php";
             ';
         }
     }