Difference between revisions of "/etc/nginx/nginx.conf"

From wikieduonline
Jump to navigation Jump to search
Line 32: Line 32:
 
* Ability to handle [[c10k problem|more than 10,000 simultaneous connections]] with a low memory footprint (~2.5 MB per 10k inactive [[HTTP persistent connection|HTTP keep-alive connections]])
 
* Ability to handle [[c10k problem|more than 10,000 simultaneous connections]] with a low memory footprint (~2.5 MB per 10k inactive [[HTTP persistent connection|HTTP keep-alive connections]])
 
* Handling of static files, index files and auto-indexing
 
* Handling of static files, index files and auto-indexing
* [[Reverse proxy]] with caching<ref>https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/</ref> (<code>[[proxy_pass]]</code>)
+
* [[Reverse proxy]] with caching<ref>https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/</ref> (<code>[[proxy_pass]]</code> directive)
* [[Load balancer|Load balancing]] with in-band health checks<ref name="Load balancing" />
+
* [[Load balancer|Load balancing]] with in-band health checks<ref name="Load balancing" /> (<code>[[upstream]]</code> directive)
 
* [[Transport Layer Security|TLS/SSL]] with [[Server Name Indication|SNI]] and [[OCSP stapling]] support, via [[OpenSSL]]
 
* [[Transport Layer Security|TLS/SSL]] with [[Server Name Indication|SNI]] and [[OCSP stapling]] support, via [[OpenSSL]]
 
* [[FastCGI]], [[SCGI]], [[uWSGI]] support with caching
 
* [[FastCGI]], [[SCGI]], [[uWSGI]] support with caching

Revision as of 11:25, 29 December 2019

wikipedia:Nginx web server that was written in 2004 as an alternative to popular Apache web server.

/etc/nginx/nginx.conf
/etc/nginx/conf.d/default.conf

Nginx logs (See also Nginx change log)

  • Error log file: /var/log/nginx/error.log
  • Access log file: /var/log/nginx/access.log
  • Logrotate: /etc/logrotate.d/nginx
  • journalctl -u nginx
journalctl -u nginx | grep emerg

Nginx Sample Configurations

Example of the simplest nginx possible configuration file, listening on default http port: 80.

/etc/nginx/conf.d/default.conf
server {
    listen 80;
    root /path/to/your/html_files;
}

Features

Nginx can be deployed to serve dynamic HTTP content on the network using FastCGI, SCGI handlers for scripts, WSGI application servers or Phusion Passenger modules, and it can serve as a software load balancer.[1]

Nginx uses an asynchronous event-driven approach, rather than threads, to handle requests.[2] Nginx's modular event-driven architecture can provide more predictable performance under high loads.[3][4]

Nginx default configuration file is nginx.conf.[5]

HTTP proxy and Web server features

Mail proxy features

Other features include upgrading executable and configuration without client connections loss,[18] and a module-based architecture with both core[19] and third-party module support.[20]

The paid Plus product includes additional features such as advanced load balancing and access to an expanded suite of metrics for performance monitoring.[21][22]

Linux Nginx Operation on systemd distributions

  • Verify/Test Configuration: nginx -t
  • Status: systemctl status nginx
  • Start: systemctl start nginx
  • Stop: systemctl stop nginx
  • Restart: systemctl restart nginx (See also: nginx -t)

Activities

See also

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

Source: https://en.wikipedia.org/wiki/Nginx

  1. Cite error: Invalid <ref> tag; no text was provided for refs named Kleinman
  2. Cite error: Invalid <ref> tag; no text was provided for refs named Welcome
  3. Cite error: Invalid <ref> tag; no text was provided for refs named aosabook
  4. Cite error: Invalid <ref> tag; no text was provided for refs named Configuration
  5. Cite error: Invalid <ref> tag; no text was provided for refs named Beginner
  6. https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/
  7. Cite error: Invalid <ref> tag; no text was provided for refs named Load balancing
  8. https://www.nginx.com/blog/nginx-1-13-10-grpc/
  9. http://nginx.org/en/docs/http/websocket.html
  10. https://nginx.org/en/docs/http/websocket.html
  11. https://www.nginx.com/blog/websocket-nginx/
  12. Cite error: Invalid <ref> tag; no text was provided for refs named 101 Switching Protocols
  13. Cite error: Invalid <ref> tag; no text was provided for refs named mdoc-intro
  14. Cite error: Invalid <ref> tag; no text was provided for refs named mdoc
  15. https://docs.nginx.com/nginx/admin-guide/mail-proxy/mail-proxy/
  16. Cite error: Invalid <ref> tag; no text was provided for refs named Authentication
  17. https://docs.nginx.com/nginx/admin-guide/mail-proxy/mail-proxy/#mail_auth
  18. Cite error: Invalid <ref> tag; no text was provided for refs named Controlling nginx
  19. Cite error: Invalid <ref> tag; no text was provided for refs named documentation
  20. Cite error: Invalid <ref> tag; no text was provided for refs named 3rdPartyModules
  21. Cite error: Invalid <ref> tag; no text was provided for refs named Plus metrics
  22. Cite error: Invalid <ref> tag; no text was provided for refs named Plus load balancing

Advertising: