- windows下安装nginx
- 相应的命令:
start nginx.exe 安装nginx
nginx.exe -s stop 停止nginx
nginx.exe -s reload 重新加载nginx
nginx.exe -s quit 退出nginx
- windows下卸载:
停止nginx进程,然后直接删除nginx文件夹即可!
- 数字证书双向认证,nginx.conf的配置
server {
listen 443 ssl; # 注意ssl
server_name localhost;#============【 add ↓】============ ssl_verify_depth 5; #证书链长度 ssl on; ssl_certificate c:/tx/sj/server1.cer; # base64编码的cer文件(下同) ssl_certificate_key c:/tx/sj/server1.key; # 注意路径斜杆 ssl_client_certificate c:/tx/sj/根证书.cer; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_verify_client on; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers HIGH:!aNULL:!MD5; #ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP; ssl_prefer_server_ciphers on; # nginx反向代理其他网站 ↓ location / { proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://192.168.0.10:691; } # nginx反向代理其他网站 ↑ #============【 add ↑】============
参考
- nginx反向代理是什么
- Nginx实现HTTP反向代理配置—— 对cnf文件配置项中文介绍很多
- nginx.cn反向代理配置
- Nginx.conf反向代理配置详解