http (全局配置) server (主机配置) upstream (负载均衡服务器配置,在http配置范围内) location (url匹配特定位置的设置)
1:反向代理 2:location/url重写 3:web缓存 4:负载均衡
vim /etc/Nginx/Nginx.conf upstream boke_web { server 192.168.1.135:80; server 192.168.1.136:80; } server { listen 443 http2; ssl on; server_name boke.wsfnk.com; ssl_certificate "/etc/pki/Nginx/boke_server.crt"; ssl_certificate_key "/etc/pki/Nginx/private/boke_server.key"; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:!3DES:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL; ssl_prefer_server_ciphers on; location / { proxy_pass http://boke_web; } error_page 404 /404.html; location = /40x.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } }
Nginx -c /etc/Nginx/Nginx.conf -t