Access_log off impact on Requests/sec

stevewin nginx-forum at forum.nginx.org
Thu Jul 28 14:32:13 UTC 2016


I am beginning to look at NGINX performance on a development system with
traffic driven by Wrk.  Initially I am just looking at static HTTP serving.

I am using NGINX v1.10.1 running on the host system with Ubuntu 16.04.  Wrk
v4.0.4 is running from a separate client platform over a private 40GB
connection.  The CPU on the host system has 24 cores (no hyperthreading).

I had started to look into various NGINX and kernel parameters for
performance optimization.  One thing that I am seeing that appears odd to me
is that when I change access_log to off (from the default of specifying a
log location) it seems to decrease the requests/sec that I am seeing when
connections increase (using defaults with everything else being equal). 
Does this make sense?

The results with defaults including ‘access_log /var/log/nginx/access.log;’
show the Requests/sec ramping up to ~24.5K and staying there.

The results with defaults and access_log changed to ‘access_log off;’ show
the Requests/sec initially ramping up to ~28.5K but then decreasing down to
~20K and staying there.

The NGINX config is at the bottom.

Can someone explain possible reasons for this behavior?

Results: access_log /var/log/nginx/access.log;

+ wrk -t8 -c8 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  8 threads and 8 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     0.87ms    3.15ms  75.93ms   97.13%
    Req/Sec     2.43k   409.97     4.43k    73.88%
  1163065 requests in 1.00m, 0.92GB read
Requests/sec:  19352.37
Transfer/sec:     15.69MB
+ wrk -t16 -c16 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  16 threads and 16 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.61ms    5.65ms 102.08ms   96.23%
    Req/Sec     1.56k   314.27     4.48k    74.08%
  1492822 requests in 1.00m, 1.18GB read
Requests/sec:  24839.12
Transfer/sec:     20.13MB
+ wrk -t16 -c24 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  16 threads and 24 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.25ms    4.48ms 102.89ms   97.37%
    Req/Sec     1.56k   312.01     3.36k    73.64%
  1493188 requests in 1.00m, 1.18GB read
Requests/sec:  24845.17
Transfer/sec:     20.14MB
+ wrk -t16 -c32 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  16 threads and 32 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     3.94ms   12.93ms 216.85ms   95.66%
    Req/Sec     1.55k   279.44     2.66k    73.49%
  1478392 requests in 1.00m, 1.17GB read
Requests/sec:  24633.34
Transfer/sec:     19.97MB
+ wrk -t16 -c48 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  16 threads and 48 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     8.71ms   24.20ms 295.25ms   93.30%
    Req/Sec     1.54k   341.58     3.03k    70.92%
  1472839 requests in 1.00m, 1.17GB read
Requests/sec:  24540.14
Transfer/sec:     19.89MB
+ wrk -t16 -c72 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  16 threads and 72 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    17.21ms   40.71ms 527.85ms   89.50%
    Req/Sec     1.55k   460.73     3.98k    68.62%
  1477573 requests in 1.00m, 1.17GB read
Requests/sec:  24620.15
Transfer/sec:     19.96MB
+ wrk -t16 -c96 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  16 threads and 96 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    36.09ms   66.94ms 728.22ms   85.22%
    Req/Sec     1.56k   548.79     5.92k    70.25%
  1475862 requests in 1.00m, 1.17GB read
Requests/sec:  24591.50
Transfer/sec:     19.93MB
+ wrk -t16 -c120 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  16 threads and 120 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    44.31ms   80.38ms 827.20ms   85.84%
    Req/Sec     1.56k   624.90     7.01k    71.66%
  1474821 requests in 1.00m, 1.17GB read
Requests/sec:  24569.45
Transfer/sec:     19.92MB
+ wrk -t16 -c200 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  16 threads and 200 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   108.02ms  165.88ms   1.33s    81.91%
    Req/Sec     1.56k   717.25     9.04k    70.01%
  1478936 requests in 1.00m, 1.17GB read
Requests/sec:  24642.54
Transfer/sec:     19.97MB
+ wrk -t16 -c300 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  16 threads and 300 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   112.68ms  193.21ms   1.87s    83.02%
    Req/Sec     1.54k   774.83    10.79k    69.02%
  1450211 requests in 1.00m, 1.15GB read
  Socket errors: connect 0, read 0, write 0, timeout 35
Requests/sec:  24161.27
Transfer/sec:     19.58MB
+ wrk -t16 -c400 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  16 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    94.84ms  182.77ms   1.76s    84.51%
    Req/Sec     1.58k     0.87k    9.04k    69.32%
  1477150 requests in 1.00m, 1.17GB read
  Socket errors: connect 0, read 14, write 0, timeout 44
Requests/sec:  24607.07
Transfer/sec:     19.95MB
+ wrk -t16 -c500 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  16 threads and 500 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    82.97ms  176.81ms   1.80s    85.91%
    Req/Sec     1.57k   842.85     8.80k    68.98%
  1483409 requests in 1.00m, 1.17GB read
  Socket errors: connect 0, read 37, write 0, timeout 111
Requests/sec:  24712.25
Transfer/sec:     20.03MB
+ wrk -t16 -c1000 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  16 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    50.99ms  146.22ms   1.87s    90.23%
    Req/Sec     1.59k     1.00k    6.05k    67.26%
  1476551 requests in 1.00m, 1.17GB read
  Socket errors: connect 0, read 0, write 0, timeout 189
Requests/sec:  24597.04
Transfer/sec:     19.94MB
+ wrk -t32 -c32 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  32 threads and 32 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     5.04ms   20.90ms 551.15ms   95.89%
    Req/Sec   784.23    217.89     2.21k    78.85%
  1472562 requests in 1.00m, 1.17GB read
Requests/sec:  24529.01
Transfer/sec:     19.88MB
+ wrk -t32 -c48 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  32 threads and 48 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     3.37ms   11.92ms 245.37ms   96.30%
    Req/Sec   774.56    204.08     1.53k    76.20%
  1475725 requests in 1.00m, 1.17GB read
Requests/sec:  24580.86
Transfer/sec:     19.92MB
+ wrk -t32 -c72 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  32 threads and 72 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    16.28ms   37.78ms 410.78ms   89.50%
    Req/Sec   779.67    313.76     2.02k    67.38%
  1481461 requests in 1.00m, 1.17GB read
Requests/sec:  24679.28
Transfer/sec:     20.00MB
+ wrk -t32 -c96 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  32 threads and 96 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    36.23ms   67.24ms 732.91ms   85.27%
    Req/Sec   783.82    382.17     3.03k    67.87%
  1476051 requests in 1.00m, 1.17GB read
Requests/sec:  24589.76
Transfer/sec:     19.93MB
+ wrk -t32 -c120 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  32 threads and 120 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    32.16ms   64.51ms 740.32ms   86.21%
    Req/Sec   784.59    387.94     3.02k    68.36%
  1475008 requests in 1.00m, 1.17GB read
Requests/sec:  24570.05
Transfer/sec:     19.92MB
+ wrk -t32 -c200 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  32 threads and 200 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   108.19ms  165.93ms   1.30s    81.86%
    Req/Sec   809.75    507.62     6.00k    70.29%
  1485154 requests in 1.00m, 1.18GB read
Requests/sec:  24739.18
Transfer/sec:     20.05MB
+ wrk -t32 -c300 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  32 threads and 300 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   112.47ms  192.19ms   1.80s    82.92%
    Req/Sec   820.73    534.45     8.41k    70.69%
  1481318 requests in 1.00m, 1.17GB read
  Socket errors: connect 0, read 0, write 0, timeout 22
Requests/sec:  24674.91
Transfer/sec:     20.00MB
+ wrk -t32 -c400 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  32 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    95.58ms  184.69ms   1.78s    84.55%
    Req/Sec   831.80    563.83     9.21k    70.44%
  1483434 requests in 1.00m, 1.17GB read
  Socket errors: connect 0, read 24, write 0, timeout 60
Requests/sec:  24709.63
Transfer/sec:     20.03MB
+ wrk -t32 -c500 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  32 threads and 500 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    82.25ms  174.44ms   1.83s    85.86%
    Req/Sec   848.41    609.18    11.97k    70.96%
  1481738 requests in 1.00m, 1.17GB read
  Socket errors: connect 0, read 0, write 0, timeout 71
Requests/sec:  24681.93
Transfer/sec:     20.01MB
+ wrk -t32 -c1000 -d1m http://<ip_appr>
Running 1m test @ http://<ip_appr>
  32 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    51.30ms  147.85ms   1.90s    90.20%
    Req/Sec     0.93k   734.15     6.80k    71.46%
  1473680 requests in 1.00m, 1.17GB read
  Socket errors: connect 3, read 23, write 0, timeout 155
Requests/sec:  24543.22
Transfer/sec:     19.89MB

Results: access_log off;

+ wrk -t8 -c8 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  8 threads and 8 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   774.84us    2.68ms  49.44ms   96.78%
    Req/Sec     2.80k   469.76     4.41k    74.47%
  1339638 requests in 1.00m, 1.06GB read
Requests/sec:  22290.17
Transfer/sec:     18.07MB
+ wrk -t16 -c16 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  16 threads and 16 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.31ms    4.55ms  87.05ms   96.49%
    Req/Sec     1.79k   367.84     4.05k    71.29%
  1707362 requests in 1.00m, 1.35GB read
Requests/sec:  28408.74
Transfer/sec:     23.03MB
+ wrk -t16 -c24 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  16 threads and 24 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.06ms    3.74ms  91.75ms   97.50%
    Req/Sec     1.79k   368.82     5.17k    70.85%
  1711617 requests in 1.00m, 1.35GB read
Requests/sec:  28479.84
Transfer/sec:     23.09MB
+ wrk -t16 -c32 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  16 threads and 32 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     3.23ms   10.78ms 329.27ms   95.58%
    Req/Sec     1.59k   374.95     3.19k    67.44%
  1522660 requests in 1.00m, 1.21GB read
Requests/sec:  25373.32
Transfer/sec:     20.57MB
+ wrk -t16 -c48 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  16 threads and 48 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     5.00ms   16.21ms 455.01ms   96.40%
    Req/Sec     1.37k   306.37     3.03k    70.59%
  1302599 requests in 1.00m, 1.03GB read
Requests/sec:  21701.73
Transfer/sec:     17.59MB
+ wrk -t16 -c72 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  16 threads and 72 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     5.37ms   14.98ms 533.50ms   96.97%
    Req/Sec     1.24k   240.24     4.04k    81.22%
  1180599 requests in 1.00m, 0.93GB read
Requests/sec:  19669.01
Transfer/sec:     15.94MB
+ wrk -t16 -c96 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  16 threads and 96 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     9.79ms   24.35ms 643.73ms   96.02%
    Req/Sec     1.24k   395.64     5.50k    73.35%
  1177464 requests in 1.00m, 0.93GB read
Requests/sec:  19616.52
Transfer/sec:     15.90MB
+ wrk -t16 -c120 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  16 threads and 120 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    12.13ms   30.99ms 665.51ms   95.94%
    Req/Sec     1.25k   480.20     7.07k    74.10%
  1189399 requests in 1.00m, 0.94GB read
Requests/sec:  19815.90
Transfer/sec:     16.06MB
+ wrk -t16 -c200 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  16 threads and 200 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    22.18ms   39.70ms 919.60ms   91.24%
    Req/Sec     1.27k   610.20    10.33k    75.28%
  1200493 requests in 1.00m, 0.95GB read
Requests/sec:  20001.03
Transfer/sec:     16.21MB
+ wrk -t16 -c300 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  16 threads and 300 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    36.75ms   56.08ms 657.81ms   87.76%
    Req/Sec     1.27k   574.61     9.56k    69.81%
  1211597 requests in 1.00m, 0.96GB read
Requests/sec:  20185.21
Transfer/sec:     16.36MB
+ wrk -t16 -c400 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  16 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    58.44ms   90.62ms   1.05s    87.38%
    Req/Sec     1.29k   607.24     4.69k    68.92%
  1232007 requests in 1.00m, 0.98GB read
Requests/sec:  20526.47
Transfer/sec:     16.64MB
+ wrk -t16 -c500 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  16 threads and 500 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    78.26ms  119.85ms   1.27s    86.15%
    Req/Sec     1.30k   609.41     4.59k    68.02%
  1238043 requests in 1.00m, 0.98GB read
Requests/sec:  20626.14
Transfer/sec:     16.72MB
+ wrk -t16 -c1000 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  16 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   164.28ms  251.12ms   2.00s    85.33%
    Req/Sec     1.33k   634.64     5.14k    70.25%
  1268711 requests in 1.00m, 1.00GB read
  Socket errors: connect 0, read 0, write 0, timeout 473
Requests/sec:  21137.30
Transfer/sec:     17.13MB
+ wrk -t32 -c32 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  32 threads and 32 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     3.18ms   10.92ms 311.69ms   95.72%
    Req/Sec   800.01    260.79     1.62k    65.96%
  1526047 requests in 1.00m, 1.21GB read
Requests/sec:  25425.33
Transfer/sec:     20.61MB
+ wrk -t32 -c48 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  32 threads and 48 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     2.72ms    9.45ms 317.84ms   96.37%
    Req/Sec   801.31    266.52     1.74k    65.56%
  1528825 requests in 1.00m, 1.21GB read
Requests/sec:  25471.82
Transfer/sec:     20.65MB
+ wrk -t32 -c72 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  32 threads and 72 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     4.87ms   12.19ms 397.58ms   96.75%
    Req/Sec   616.49    141.23     2.02k    73.03%
  1177789 requests in 1.00m, 0.93GB read
Requests/sec:  19619.93
Transfer/sec:     15.90MB
+ wrk -t32 -c96 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  32 threads and 96 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     9.89ms   21.94ms 542.41ms   94.81%
    Req/Sec   628.32    283.23     2.99k    71.33%
  1199534 requests in 1.00m, 0.95GB read
Requests/sec:  19978.86
Transfer/sec:     16.19MB
+ wrk -t32 -c120 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  32 threads and 120 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    10.58ms   31.92ms 706.99ms   96.66%
    Req/Sec   629.12    297.85     3.02k    70.08%
  1195385 requests in 1.00m, 0.95GB read
Requests/sec:  19913.97
Transfer/sec:     16.14MB
+ wrk -t32 -c200 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  32 threads and 200 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    22.31ms   43.63ms   1.06s    93.06%
    Req/Sec   641.57    423.60     5.97k    69.57%
  1213269 requests in 1.00m, 0.96GB read
Requests/sec:  20210.94
Transfer/sec:     16.38MB
+ wrk -t32 -c300 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  32 threads and 300 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    35.67ms   58.67ms 965.84ms   89.02%
    Req/Sec   648.76    458.09     7.70k    70.86%
  1221406 requests in 1.00m, 0.97GB read
Requests/sec:  20347.10
Transfer/sec:     16.49MB
+ wrk -t32 -c400 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  32 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    49.30ms   76.09ms   1.32s    87.03%
    Req/Sec   652.46    467.17     9.95k    68.56%
  1227466 requests in 1.00m, 0.97GB read
Requests/sec:  20447.03
Transfer/sec:     16.57MB
+ wrk -t32 -c500 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  32 threads and 500 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    63.83ms   93.94ms   1.35s    85.94%
    Req/Sec   651.42    460.18     3.28k    65.49%
  1243957 requests in 1.00m, 0.98GB read
Requests/sec:  20723.24
Transfer/sec:     16.80MB
+ wrk -t32 -c1000 -d1m http://<ip_addr>
Running 1m test @ http://<ip_addr>
  32 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   161.91ms  255.76ms   2.00s    85.74%
    Req/Sec   659.45    437.48     3.99k    69.13%
  1257867 requests in 1.00m, 1.00GB read
  Socket errors: connect 3, read 0, write 0, timeout 1163
Requests/sec:  20952.53
Transfer/sec:     16.98MB




NGINX config:

root at ubuntu:/home/ubuntu# nginx -T
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# configuration file /etc/nginx/nginx.conf:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
        worker_connections 768;
        # multi_accept on;
}
http {
        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        #access_log /var/log/nginx/access.log;
        access_log off;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;
        gzip_disable "msie6";

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json
application/javascript text/xml application/xml application/xml+rss
text/javascript;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}


#mail {
#       # See sample authentication script at:
#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#       # auth_http localhost/auth.php;
#       # pop3_capabilities "TOP" "USER";
#       # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#       server {
#               listen     localhost:110;
#               protocol   pop3;
#               proxy      on;
#       }
#
#       server {
#               listen     localhost:143;
#               protocol   imap;
#               proxy      on;
#       }
#}

# configuration file /etc/nginx/mime.types:

types {
    text/html                             html htm shtml;
    text/css                              css;
    text/xml                              xml;
    image/gif                             gif;
    image/jpeg                            jpeg jpg;
    application/javascript                js;
    application/atom+xml                  atom;
    application/rss+xml                   rss;

    text/mathml                           mml;
    text/plain                            txt;
    text/vnd.sun.j2me.app-descriptor      jad;
    text/vnd.wap.wml                      wml;
    text/x-component                      htc;

    image/png                             png;
    image/tiff                            tif tiff;
    image/vnd.wap.wbmp                    wbmp;
    image/x-icon                          ico;
    image/x-jng                           jng;
    image/x-ms-bmp                        bmp;
    image/svg+xml                         svg svgz;
    image/webp                            webp;

    application/font-woff                 woff;
    application/java-archive              jar war ear;
    application/json                      json;
    application/mac-binhex40              hqx;
    application/msword                    doc;
    application/pdf                       pdf;
    application/postscript                ps eps ai;
    application/rtf                       rtf;
    application/vnd.apple.mpegurl         m3u8;
    application/vnd.ms-excel              xls;
    application/vnd.ms-fontobject         eot;
    application/vnd.ms-powerpoint         ppt;
    application/vnd.wap.wmlc              wmlc;
    application/vnd.google-earth.kml+xml  kml;
    application/vnd.google-earth.kmz      kmz;
    application/x-7z-compressed           7z;
    application/x-cocoa                   cco;
    application/x-java-archive-diff       jardiff;
    application/x-java-jnlp-file          jnlp;
    application/x-makeself                run;
    application/x-perl                    pl pm;
    application/x-pilot                   prc pdb;
    application/x-rar-compressed          rar;
    application/x-redhat-package-manager  rpm;
    application/x-sea                     sea;
    application/x-shockwave-flash         swf;
    application/x-stuffit                 sit;
    application/x-tcl                     tcl tk;
    application/x-x509-ca-cert            der pem crt;
    application/x-xpinstall               xpi;
    application/xhtml+xml                 xhtml;
    application/xspf+xml                  xspf;
    application/zip                       zip;

    application/octet-stream              bin exe dll;
    application/octet-stream              deb;
    application/octet-stream              dmg;
    application/octet-stream              iso img;
    application/octet-stream              msi msp msm;

    application/vnd.openxmlformats-officedocument.wordprocessingml.document 
  docx;
    application/vnd.openxmlformats-officedocument.spreadsheetml.sheet       
  xlsx;
   
application/vnd.openxmlformats-officedocument.presentationml.presentation 
pptx;

    audio/midi                            mid midi kar;
    audio/mpeg                            mp3;
    audio/ogg                             ogg;
    audio/x-m4a                           m4a;
    audio/x-realaudio                     ra;

    video/3gpp                            3gpp 3gp;
    video/mp2t                            ts;
    video/mp4                             mp4;
    video/mpeg                            mpeg mpg;
    video/quicktime                       mov;
    video/webm                            webm;
    video/x-flv                           flv;
    video/x-m4v                           m4v;
    video/x-mng                           mng;
    video/x-ms-asf                        asx asf;
    video/x-ms-wmv                        wmv;
    video/x-msvideo                       avi;
}

# configuration file /etc/nginx/sites-enabled/default:
##
# You should look at the following URL's in order to grasp a solid
understanding
# of Nginx configuration files in order to fully unleash the power of
Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a
clean
# file but keep this around for reference. Or just disable in
sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
        listen 80 default_server;
        listen [::]:80 default_server;

        # SSL configuration
        #
        # listen 443 ssl default_server;
        # listen [::]:443 ssl default_server;
        #
        # Note: You should disable gzip for SSL traffic.
        # See: https://bugs.debian.org/773332
        #
        # Read up on ssl_ciphers to ensure a secure configuration.
        # See: https://bugs.debian.org/765782
        #
        # Self signed certs generated by the ssl-cert package
        # Don't use them in a production server!
        #
        # include snippets/snakeoil.conf;

        root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html;

        server_name _;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

        # pass the PHP scripts to FastCGI server listening on
127.0.0.1:9000
        #
        #location ~ \.php$ {
        #       include snippets/fastcgi-php.conf;
        #
        #       # With php7.0-cgi alone:
        #       fastcgi_pass 127.0.0.1:9000;
        #       # With php7.0-fpm:
        #       fastcgi_pass unix:/var/run/php7.0-fpm.sock;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #       deny all;
        #}
}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink
that
# to sites-enabled/ to enable it.
#
#server {
#       listen 80;
#       listen [::]:80;
#
#       server_name example.com;
#
#       root /var/www/example.com;
#       index index.html;
#
#       location / {
#               try_files $uri $uri/ =404;
#       }
#}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,268609,268609#msg-268609



More information about the nginx mailing list