1- user www-data;
2- worker_processes 3;
1+ # /etc/nginx/nginx.conf
32
4- error_log /var/log/nginx/error.log warn;
5- pid /var/run/nginx.pid ;
3+ user www;
4+
5+ # Set number of worker processes automatically based on number of CPU cores.
6+ worker_processes auto;
7+
8+ # Enables the use of JIT for regular expressions to speed-up their processing.
9+ pcre_jit on;
10+
11+ pid /var/run/nginx.pid ;
12+
13+ # Configures default error logger.
14+ error_log /var/log/nginx/error.log warn;
15+
16+ # Includes files with directives to load dynamic modules.
17+ include /etc/nginx/modules/*.conf;
618
719
820events {
9- worker_connections 1024 ;
21+ # The maximum number of simultaneous connections that can be opened by
22+ # a worker process.
23+ worker_connections 1024 ;
1024}
1125
12-
1326http {
14- include /etc/nginx/mime.types ;
15- default_type application/octet-stream ;
27+ # Includes mapping of file name extensions to MIME types of responses
28+ # and defines the default type.
29+ include /etc/nginx/mime.types ;
30+ default_type application/octet-stream ;
31+
32+ # Name servers used to resolve names of upstream servers into addresses.
33+ # It's also needed when using tcpsocket and udpsocket in Lua modules.
34+ #resolver 208.67.222.222 208.67.220.220;
35+
36+ # Don't tell nginx version to clients.
37+ server_tokens off;
38+
39+ # Specifies the maximum accepted body size of a client request, as
40+ # indicated by the request header Content-Length. If the stated content
41+ # length is greater than this size, then the client receives the HTTP
42+ # error code 413. Set to 0 to disable.
43+ client_max_body_size 1m ;
44+
45+ # Timeout for keep-alive connections. Server will close connections after
46+ # this time.
47+ keepalive_timeout 65 ;
48+
49+ # Sendfile copies data between one FD and other from within the kernel,
50+ # which is more efficient than read() + write().
51+ sendfile on;
52+
53+ # Don't buffer data-sends (disable Nagle algorithm).
54+ # Good for sending frequent small bursts of data in real time.
55+ tcp_nodelay on;
56+
57+ # Causes nginx to attempt to send its HTTP response head in one packet,
58+ # instead of using partial frames.
59+ #tcp_nopush on;
60+
61+
62+ # Path of the file with Diffie-Hellman parameters for EDH ciphers.
63+ #ssl_dhparam /etc/ssl/nginx/dh2048.pem;
64+
65+ # Specifies that our cipher suits should be preferred over client ciphers.
66+ ssl_prefer_server_ciphers on;
67+
68+ # Enables a shared SSL cache with size that can hold around 8000 sessions.
69+ ssl_session_cache shared:SSL:2m ;
1670
17- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
18- '$status $body_bytes_sent "$http_referer" '
19- '"$http_user_agent" "$http_x_forwarded_for"' ;
2071
21- access_log /var/log/nginx/access.log main;
72+ # Enable gzipping of responses.
73+ #gzip on;
2274
23- sendfile on ;
24- #tcp_nopush on;
75+ # Set the Vary HTTP header as defined in the RFC 2616.
76+ gzip_vary on;
2577
26- keepalive_timeout 65 ;
78+ # Enable checking the existence of precompressed files.
79+ #gzip_static on;
2780
28- gzip on;
2981
30- server {
31- listen 80 ;
32- root /var/www/html ;
33- index index .php index .html ;
82+ # Specifies the main log format.
83+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
84+ '$status $body_bytes_sent "$http_referer" '
85+ '"$http_user_agent" "$http_x_forwarded_for"' ;
3486
35- location / {
36- try_files $uri $uri / /index .php?$query_string ;
37- }
87+ # Sets the path, format, and configuration for a buffered log write.
88+ access_log /var/log/nginx/access.log main;
3889
39- location ~ \.php$ {
40- fastcgi_pass 127.0.0.1:9000 ;
41- fastcgi_index index .php;
42- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name ;
43- include fastcgi_params;
44- }
45- }
4690
47- include conf.d/* ;
91+ # Includes virtual hosts configs.
92+ include /etc/nginx/conf.d/*.conf;
4893}
0 commit comments