upstream tomcat {
    ip_hash;
    server was-server:8080;
}

server {
    listen 8080;
    access_log /var/log/nginx/test.log;

location / {
#주석처리
        #root /usr/share/nginx/html;
        index index.html index.htm index.jsp;
        proxy_pass http://tomcat;
    }
#static 정적파일
    location ~ \.(css|js|jpg|jpeg|gif|htm|html|swf)$ {
        root /usr/share/nginx/html;
        index index.html index.htm;
    }
#jsp or do 처리
    location ~ \.(jsp|do)$ {
    index index.jsp;
        proxy_pass http://tomcat;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-NginX-Proxy true;
        proxy_set_header Host $http_host;

    proxy_redirect off;
    charset utf-8;
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
        root /usr/share/nginx/html;
    }
}