Difference between revisions of "Nginx"

From wikieduonline
Jump to navigation Jump to search
(Welcome moved page Nginx to /etc/nginx/nginx.conf)
Tag: New redirect
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
#REDIRECT [[/etc/nginx/nginx.conf]]
+
[[wikipedia:Nginx]] [[web server]] that was written in 2004 as an alternative to popular [[Apache]] [[web server]].
 +
 
 +
* Official documentation: https://nginx.org/en/docs/
 +
* Configuration Files:
 +
:<code>[[/etc/nginx/nginx.conf]]</code>
 +
:<code>/etc/nginx/conf.d/[[default.conf]]</code>
 +
:<code>/etc/nginx/sites-enabled</code>
 +
 
 +
[[Nginx logs]] (See also [[Nginx change log]])
 +
* Error log file: <code>/var/log/nginx/[[error.log (Nginx)|error.log]]</code>
 +
* Access log file: <code>/var/log/nginx/access.log</code>
 +
* [[Logrotate]]: <code>/etc/logrotate.d/nginx</code>
 +
* <code>[[journalctl]] -u nginx</code>
 +
::<code>[[journalctl -u nginx]] | grep [[emerg]]</code>
 +
 
 +
== Installation ==
 +
[[Ubuntu]]
 +
apt install [[nginx-light]]
 +
[[systemctl status nginx]]
 +
[[/var]]/www/html/
 +
 
 +
[[apt install]] nginx
 +
 
 +
[[Docker Nginx]] https://hub.docker.com/_/nginx
 +
 
 +
== [[Nginx Sample Configurations]] ==
 +
 
 +
== Features ==
 +
Nginx can be deployed to serve dynamic [[HTTP]] content on the network using [[FastCGI]], [[SCGI]] handlers for [[scripting language|scripts]], [[Web Server Gateway Interface|WSGI]] application servers or [[Phusion Passenger]] modules, and it can serve as a software [[load balancer]].<ref name="Kleinman" />
 +
 
 +
Nginx uses an [[asynchronous system|asynchronous]] [[event (computing)|event-driven]] approach, rather than threads, to handle requests.<ref name="Welcome" /> Nginx's modular [[event-driven architecture]] can provide more predictable performance under high loads.<ref name="aosabook" /><ref name="Configuration" />
 +
 
 +
Nginx default configuration file is <code>nginx.conf</code>.<ref name="Beginner" />
 +
 
 +
=== HTTP proxy and Web server features ===
 +
* Ability to handle [[c10k problem|more than 10,000 simultaneous connections]] with a low memory footprint (~2.5&nbsp;MB per 10k inactive [[HTTP persistent connection|HTTP keep-alive connections]])
 +
* 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> [[directive]]) (Do not support [[proxy]] <ref>https://serverfault.com/a/298401</ref>)
 +
* [[Load balancer|Load balancing]] with in-band health checks<ref name="Load balancing" /> (<code>[[upstream]]</code> directive)
 +
* [[TLS]]/[[SSL]] with [[Server Name Indication|SNI]] and [[OCSP stapling]] support, via [[OpenSSL]]
 +
* [[FastCGI]], [[SCGI]], [[uWSGI]] support with caching
 +
* [[gRPC]] support since March 2018, version 1.13.10.<ref>https://www.nginx.com/blog/nginx-1-13-10-grpc/</ref>
 +
* Name- and IP address-based virtual servers
 +
* [[IPv6]]-compatible
 +
* [[WebSocket]]s since 1.3.13,<ref>http://nginx.org/en/docs/http/websocket.html</ref><ref>https://nginx.org/en/docs/http/websocket.html</ref> including acting as a reverse proxy and do load balancing of WebSocket applications.<ref>https://www.nginx.com/blog/websocket-nginx/</ref>
 +
* [[HTTP/1.1 Upgrade header|HTTP/1.1 Upgrade (101 Switching Protocols)]],<ref name="101 Switching Protocols" /> [[HTTP/2]] protocol support
 +
* [[rewrite engine|URL rewriting]] and [[URL redirection|redirection]]<ref name="mdoc-intro" /><ref name="mdoc" />
 +
 
 +
=== Mail proxy features ===
 +
* [[Transport Layer Security|TLS/SSL]] support
 +
* [[STARTTLS]] support
 +
* [[SMTP]],<ref>https://docs.nginx.com/nginx/admin-guide/mail-proxy/mail-proxy/</ref> [[POP3]], and [[IMAP]] [[Proxy server|proxy]]
 +
* Requires Authentication using an external HTTP server or by an authentication script<ref name="Authentication" /><ref>https://docs.nginx.com/nginx/admin-guide/mail-proxy/mail-proxy/#mail_auth</ref>
 +
 
 +
Other features include upgrading executable and configuration without client connections loss,<ref name="Controlling nginx" /> and a module-based architecture with both core<ref name="documentation" /> and third-party module support.<ref name="3rdPartyModules" />
 +
 
 +
The paid [[Nginx]] Plus product includes additional features such as advanced [[load balancing]] and access to an expanded suite of metrics for performance monitoring.<ref name="Plus metrics" /><ref name="Plus load balancing" />
 +
 
 +
== Linux Nginx Operation on [[systemd]] distributions ==
 +
* Verify/Test Configuration: <code>[[nginx -t]]</code>
 +
* Status: <code>[[systemctl]] status nginx</code>
 +
* Start: <code>systemctl start nginx</code>
 +
* Stop: <code>systemctl stop nginx</code>
 +
* Restart: <code>systemctl restart nginx</code> (See also: <code>[[nginx -t]]</code>)
 +
 
 +
== Activities ==
 +
* [[Track Application Response time in Nginx]]
 +
* Enable status page in [[Nginx]] to get information about active connections and other parameters: https://easyengine.io/tutorials/nginx/status-page/ and test it: <code>curl http://127.0.0.1/nginx_status</code>
 +
* Read [[Nginx change log|Nginx Change log]]
 +
* [[Configure HTTP to HTTPs redirection with Nginx]]
 +
* Review [[SSL]] nginx configuration
 +
 
 +
Medium
 +
* Use <code>[[prometheus]]-[[nginx]]-exporter</code> to collect Nginx metrics
 +
 
 +
== Related terms ==
 +
* [[NGINX Amplify]] [[SaaS]]
 +
 
 +
== See also ==
 +
* {{certbot}}
 +
* {{nginx}}
 +
* {{http}}
 +
* {{proxy}}
 +
* [[Nagios]]: <code>[[check_http]]</code>
 +
 
 +
[[Category:Web]]
 +
[[Category:Nginx]]
 +
 
 +
{{CC license}}
 +
Source: https://en.wikipedia.org/wiki/Nginx

Revision as of 10:49, 3 March 2021

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
/etc/nginx/sites-enabled

Nginx logs (See also Nginx change log)

journalctl -u nginx | grep emerg

Installation

Ubuntu

apt install nginx-light
systemctl status nginx
/var/www/html/
apt install nginx

Docker Nginx https://hub.docker.com/_/nginx

Nginx Sample Configurations

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,[19] and a module-based architecture with both core[20] and third-party module support.[21]

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

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

Medium

Related terms

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. https://serverfault.com/a/298401
  8. Cite error: Invalid <ref> tag; no text was provided for refs named Load balancing
  9. https://www.nginx.com/blog/nginx-1-13-10-grpc/
  10. http://nginx.org/en/docs/http/websocket.html
  11. https://nginx.org/en/docs/http/websocket.html
  12. https://www.nginx.com/blog/websocket-nginx/
  13. Cite error: Invalid <ref> tag; no text was provided for refs named 101 Switching Protocols
  14. Cite error: Invalid <ref> tag; no text was provided for refs named mdoc-intro
  15. Cite error: Invalid <ref> tag; no text was provided for refs named mdoc
  16. https://docs.nginx.com/nginx/admin-guide/mail-proxy/mail-proxy/
  17. Cite error: Invalid <ref> tag; no text was provided for refs named Authentication
  18. https://docs.nginx.com/nginx/admin-guide/mail-proxy/mail-proxy/#mail_auth
  19. Cite error: Invalid <ref> tag; no text was provided for refs named Controlling nginx
  20. Cite error: Invalid <ref> tag; no text was provided for refs named documentation
  21. Cite error: Invalid <ref> tag; no text was provided for refs named 3rdPartyModules
  22. Cite error: Invalid <ref> tag; no text was provided for refs named Plus metrics
  23. Cite error: Invalid <ref> tag; no text was provided for refs named Plus load balancing

Advertising: