nginx-tomcat-ssh-域名

1. tomcat 存放war;

webapps/mvn-web.war
 

2. nginx 配置tomcat:

 server {
        listen       8090;
        server_name  localhost;
        location / {
            proxy_pass http://127.0.0.1:8011;
        }
    }
 

3. nginx 配置ssh:

start nginx.exe
nginx.exe -s reload
nginx.exe -s stop
nginx.exe -t
  server {
            listen       443 ssl;
            listen       [::]:443 ssl;
            charset utf-8;
            server_name localhost; 
        
        ssl_certificate      xt.cer;   
            ssl_certificate_key  xt.key;
        
        ssl_session_timeout 5m;   
        
        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;    
    
        location / {
            proxy_pass http://127.0.0.1:8011;
            #root   /usr/Selonn; 
            #index  index.html index.htm;  
        }
    }
如果443被占用了:
运行 cmd, 输入netstat -aon|findstr "443"
找到 0.0.0.0:443,找到 PID,在任务管理器结束进程。 vmware-hostd.exe

4. nginx 配置域名:

http://www.testnginx.com:8090/

修改hosts
C:\Windows\System32\drivers\etc
127.0.0.1    www.testnginx.com


 server {
        listen       8090;
        server_name  www.testnginx.com;
        location / {
            proxy_pass http://127.0.0.1:8080;
        }
 }



server {
        listen       443 ssl;
            listen       [::]:443 ssl;
            charset utf-8;
        server_name     www.testnginx.com;
        
        ssl_certificate      xt.cer;   
            ssl_certificate_key  xt.key;
        
        ssl_session_timeout 5m;   
        
        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;    
    
        location / {
            proxy_pass http://127.0.0.1:8080;
        }
    }

 

5. nginx 配置location:

server {
        listen       8090;
        server_name  www.testnginx.com;
        location /pass/ {
            proxy_pass http://127.0.0.1:8080/;
        }
}

 

 

 
 

6. tomcat 配置域名:

修改hosts
C:\Windows\System32\drivers\etc
127.0.0.1    www.testnginx.com

 

 

 

 

 

 

posted @ 2021-03-24 10:44  Alice的小屋  阅读(60)  评论(0编辑  收藏  举报