server {
  listen 80 ;
  # root /opt/dist;
  root /opt/dist;
  index index.html index.htm index.nginx-debian.html;
  # MIME
  include /etc/nginx/mime.types;
  default_type application/octet-stream;
  # Display nginx Version number in error or http header may result in hacker to search for known vulnerability. Therefore, the version number should be removed for every http response.
  server_tokens "off";
  #charset utf-8;
  # This directive, by default, is disabled to allow small packets to wait for a specified period before they are sent at once. To allow all data to be sent at once, this directive is enabled.
  tcp_nodelay on;
  #  Because we have enabled tcp_nodelay directive, small packets are sent at once. However, if you still want to make use of John Nagle’s buffering algorithm, we can also enable the tcp_nopush to add packets to each other and send them all at once.
  tcp_nopush on;
  # Defines a timeout for reading client request body. The timeout is set only for a period between two successive read operations, not for the transmission of the whole request body. If a client does not transmit anything within this time, the 408 (Request Time-out) error is returned to the client.
  client_body_timeout 12;
  # Defines a timeout for reading client request header. If a client does not transmit the entire header within this time, the 408 (Request Time-out) error is returned to the client.
  client_header_timeout 12;
  # This directive sets the buffer size for the request body. If you plan to run the webserver on 64-bit systems, you need to set the value to 16k. If you want to run the webserver on the 32-bit system, set the value to 8k.
  client_body_buffer_size 1M;
  # Similar to the previous directive, only instead it handles the client header size. For all intents and purposes, 1K is usually a decent size for this directive not unless you're sending mayopic stuff via header i.e permissions.
  client_header_buffer_size 1k;
  # The maximum number and size of buffers for large client headers.
  large_client_header_buffers 2 1k;
  # The maximum allowed size for a client request. If the maximum size is exceeded, then Nginx will spit out a 413 error or Request Entity Too Large.
  client_max_body_size 500M;
  # Defines the maximum size of an entry in the MIME types hash tables.
  types_hash_max_size 4096;
  # The first parameter sets a timeout during which a keep-alive client connection will stay open on the server side. The zero value disables keep-alive client connections. The optional second parameter sets a value in the “Keep-Alive: timeout=time” response header field. Two parameters may differ. The “Keep-Alive: timeout=time” header field is recognized by Mozilla and Konqueror. The default is 75 seconds.
  keepalive_timeout 120s;
  # Configure a number of requests to keep alive for a specific period of time.  You can set the number of requests to 20 or 30.
  keepalive_requests 120;
  # if you want to disable keepalive connection for a specific group of browsers, use this directive.
  #keepalive_disable;
  #Sets a timeout for transmitting a response to the client. The timeout is set only between two successive write operations, not for the transmission of the whole response. If the client does not receive anything within this time, the connection is closed.
  send_timeout 75s;

  include /etc/nginx/setting/general.conf;
  include /etc/nginx/setting/security.conf;
  include /etc/nginx/setting/proxy.conf;
}
