Nginx反向代理SSL
<h2>一、进入nginx目录,创建cert目录</h2>
<pre><code class="language-bash">cd /usr/local/nginx && mkdir cert</code></pre>
<h2>二、将<strong>.bundle.crt和</strong>.com.key上传到cert目录</h2>
<h2>三、修改nginx.conf文件</h2>
<pre><code class="language-bash"># 新加一个server模块
server{
listen 80;
listen 443 ssl;
server_name yunwei-prometheus.shiyue.com;
ssl_certificate /usr/local/nginx/cert/shiyue.com_bundle.crt;
ssl_certificate_key /usr/local/nginx/cert/shiyue.com.key;
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;
charset koi8-r;
location ~/ {
root html;
proxy_pass http://180.184.138.201:9090; # 要跳转的网页
index index.html index.html;
}
}</code></pre>
<h2>四、重启nginx</h2>
<pre><code class="language-bash">./nginx -s reload</code></pre>