-
Notifications
You must be signed in to change notification settings - Fork 12
nginx
kimschles edited this page Sep 7, 2018
·
1 revision
- nginx is a webserver, proxy and load balancer
- the most well-known nginx project is the open source version
- also available is nginx +, and other enterprise offerings
- nginx was developed by Igor Sysoev to solve the C10K problem (concurrently handling 10,000 connections)
sudo apt-get update && sudo apt-get upgrade -y
- Download the signing key
curl -o nginx_signing.key http://nginx.org/keys/nginx_signing.key
- Save the key in your apt-key
sudo apt-key add nginx_signing.key
- Update your sources list to include the latest stable version of nginx
sudo vim /etc/apt/sources.list
- Append these lines:
## Add official NGINX repository
deb http://nginx.org/packages/ubuntu/ xenial nginx
deb-src http://nginx.org/packages/ubuntu/ xenial nginx
- Install nginx:
sudo apt-get update && sudo apt-get install -y nginx
sudo systemctl start nginx
sudo systemctl enable nginx
- The nginx configuration files live in
/etc/nginx
directory - There are directives and contexts in the
nginx.config
file- Directives are key:value pairs separated with a space
- Ex:
user nginx;
- Ex:
- Contexts are named and the values are between curly braces
- Ex:
events { worker_connections 1024; }
- Directives are key:value pairs separated with a space
- Variables start with a dollar sign
- Ex:
$request
- Ex:
- Comments start with a hash and no space
- #Thisisacomment