- Web Server
- Load Balancer
- Reverse Proxy
- Monitoring and Management
- 100-199 : Information status codes
- 200-299 : Success status codes
- 300-399 : Redirection status codes
- 400-499 : Client error status codes
- 500-599 : Server error status codes
example:
- 301: Move Permanently
- 304: Not modified
- 401: Un-Authorized
- 403: Forbidden
- 404: Page not found
- 500: Internal Server Error
docker pull nginx
docker run -d --name nginx-test -p 8080:80 nginx
docker exec -it docker-name bash
service nginx start
service nginx stop
service nginx status
/conf/nginx/nginx.conf
user nginx;
worker_processes auto;
- worker_processes auto; it means nginx master creates worker processes by core cpu number.
- worker_processes 1; this one creates 1 worker process.
nginx -t
/usr/share/nginx/html/
server {
server_name localhost;
location / {
root /var/www;
index index.html;
}
}
we can validate config file with nginx -t and after that we can reload nginx server:
service nginx reload
server {
server_name localhost;
location / {
proxy_pass http://google.com
}
}
directive syntax: proxy_pass ;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-By $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;