--------------------sunkaikees@gmail.com-------------------

Java-nginx配置https

server {
#        listen 80;  // 如果开启443,80最好关掉
        listen 443 ssl;

        ssl_certificate /etc/nginx/conf.d/ssl/server.crt;  // 公私钥加载位置
        ssl_certificate_key /etc/nginx/conf.d/ssl/server.key;


        server_name localhost;

        access_log /var/log/nginx/syncSign_web.access.log;
        error_log /var/log/nginx/syncSign_web.error.log;

        location / {
                root /root/build_dhFront;
                index index.html;
                try_files $uri $uri/ /index.html;
         }
     // 将所有api接口的请求直接代理到本地8088端口,前端js项目中不需要填写IP和port
        location /api/ {
                proxy_pass http://127.0.0.1:8088;
        }
}

 用到的https自签名证书的生成方式:

https://www.cnblogs.com/sunkaikees/p/10273897.html

 

posted @ 2019-01-16 09:57  雪天微风吹  阅读(1532)  评论(0编辑  收藏  举报