打开linux下Nginx安装目录找到配置文件nginx.conf(一般路径为:/usr/local/nginx/conf)进行如下配置
1 # HTTPS server
2 server {
3 listen 443 ssl;#网页浏览端口,主要是用于HTTPS服务
4 server_name www.asquirrel.cn asquirrel.cn;#顶级域名,二级域名
5 ssl on;
6 ssl_certificate 1_asquirrel.cn_bundle.crt;#证书路径
7 ssl_certificate_key 2_asquirrel.cn.key;#证书秘钥路径
8 ssl_session_timeout 5m;
9 fastcgi_param HTTPS on;
10 fastcgi_param HTTP_SCHEME https;
11 location / {
12 proxy_pass https://ewp_web_contract; #代理转发的路径
13 proxy_redirect default;
14 proxy_set_header Host $host;
15 proxy_set_header X-Real-IP $remote_addr;
16 proxy_set_header X-Forwarded-for $proxy_add_x_forwarded_for;
17 proxy_set_header X-Forwarded-Proto https;
18 error_page 502 = /500.html;
19 }
20
21 }