nginx实现SSL卸载
#usernobody;worker_processes3;
#error_loglogs/error.log;
#error_loglogs/error.lognotice;
#error_loglogs/error.loginfo;
#pid logs/nginx.pid;
events {
use epoll;
worker_connections1024;
}
http {
include mime.types;
default_typeapplication/octet-stream;
#log_formatmain'$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_loglogs/access.logmain;
sendfile on;
#tcp_nopush on;
#keepalive_timeout0;
keepalive_timeout65;
#gzipon;
server {
listen 80;
server_namelocalhost;
#charset koi8-r;
#access_loglogs/host.access.logmain;
location / {
root /var/www/html;
indexindex.html index.htm;
}
#error_page404 /404.html;
error_page 500 502 503 504/50x.html;
location = /50x.html {
root html;
}
}
###################具体配置#################################
upstream https { #定义upstream模块
least_conn; #调度算法
server192.168.112.131:80 weight=2max_fails=4fail_timeout=1; #
server127.0.0.1:80backup;#本地作为备份服务器
}
# HTTPS server
#
server {
listen 443 ssl;
server_namelocalhost;
ssl_certificate ssl/nginx.crt;#证书位置
ssl_certificate_keyssl/nginx.pri;#私钥位置
ssl_session_cache shared:SSL:1m;
ssl_session_timeout5m;
ssl_ciphersHIGH:!aNULL:!MD5;
ssl_prefer_server_cipherson;
location / {
proxy_pass # 反向负载
add_header Real-Server $upstream_addr;##响应报文添加rs地址
}
}
}
页:
[1]