Nginx+tomcat部署记录

1.环境说明

win7 系统
nginx-1.9.4
apache-tomcat-7.0.63

2.修改配置

nginx.conf

    upstream tomcat {
        server 192.168.18.202:8080 fail_timeout=0;
        #ip_hash;   

    }  
    server {
        listen       8090;
        server_name  192.168.18.202;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_redirect off;
            proxy_connect_timeout      240;
            proxy_send_timeout         240;
            proxy_read_timeout         240;
            proxy_pass http://tomcat;
        }
    }

tomcat,server.xml

    

    
        
           
        
    

3.启动

启动tomcat
    startup.bat
启动Nginx
    cmd
    cd D:\nginx-1.9.4
    D:\nginx-1.9.4>nginx
停止Nginx
    D:\nginx-1.9.4>nginx -s stop

4.访问

https://localhost:8090/

你可能感兴趣的:(Nginx+tomcat部署记录)