server { listen 80; server_name kaoshi.java456.com; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://127.0.0.1:8083; index index.html index.htm; } }
server { listen 80; server_name blog.java456.com; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://127.0.0.1:8081; index index.html index.htm; client_max_body_size 50m; } }
# 以下部分部分是ssl证书的配置; server { listen 443 ; server_name dk.java456.com; ssl on; root html; index index.html index.htm; #为虚拟主机指定pem格式的证书文件 ssl_certificate cert/1454125_dk.java456.com.pem; #为虚拟主机指定私钥文件 ssl_certificate_key cert/1454125_dk.java456.com.key; #ssl_session_cache shared:SSL:1m; ssl_session_timeout 10m; #指定使用的ssl协议 ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; ssl_prefer_server_ciphers on; location / { proxy_pass http://127.0.0.1:8080; index index.html index.htm; } } server { listen 80; server_name dk.java456.com; rewrite ^(.*)$ https://$host$1 permanent; }
证书位置
sudo ./nginx -s reload
站长微信:xiaomao0055
站长QQ:14496453