# 转发http
# nginx 子站点tcp转发
server{
listen 80 ;
listen 443;
server_name kbash.cn www.kbash.cn;
location / {
proxy_pass http://eisc.cn;
index index.php index.html;
}
}
# 转发 https
# 注意如果需要配置ssl 需要再nginx 主配置 /etc/nginx/nginx.conf 文件 http 模块文件加入ssl 证书配置,否则子站点无法设置ssl ,将会报错
ssl_certificate /www/www/ssl/www/eisc.pem;
ssl_certificate_key /www/www/ssl/www/eisc.key;
#------------- https 站点 ----------#
server{
listen 443 ssl;
server_name eisc.cn www.eisc.cn;
#---------------- ssl 证书 ----------------------
ssl_certificate /www/www/ssl/www/eisc.pem;
ssl_certificate_key /www/www/ssl/www/eisc.key;
#ssl on;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
#---------- nginx 添加消息头部 --------------#
add_header jiedian "eisc.cn-ceshi";
add_header "开发商" "小绿叶技术博客eisc.cn";
add_header "节点" "小绿叶总站--总部";
#-------------------- 转发目的地址 ----------------------#
location / {
proxy_pass http://eisc.cn;
}
}