nginx与tomcat 实现代理

发布时间:2018-08-14 15:35:33

定义tomcat 

upstream tomcat_demo {

            server 127.0.0.1:8080;

         }


指定域名

server {

        listen       80;

        server_name  www.dbvpm.com; (指定域名)


指定代理

location / {

            proxy_pass http://tomcat_demo;(定义的tomcat)

            index  index.html index.htm;

        }

开启ssl

 server {

        listen  443 default ssl;

        server_name www.dbvpm.com

ssl on;

root html;

index index.html index.htm;

        ssl_certificate      1532776529184.pem;

        ssl_certificate_key  1532776529184.key;


        #ssl_session_cache    shared:SSL:1m;

        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;

location / {

            proxy_pass http://tomcat_dbvpm;

            index  index.html index.htm;

        }

    }



Card image cap
APP STORE
Card image cap
应用宝
Card image cap
小米
Card image cap
华为