upstream merchant_tomcat {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name api.esq-coffee.com;
index index.jsp index.html;
location /coffee-merchant-api/swagger {
root /data/syct/apache-tomcat-merchant-api;
proxy_pass http://merchant_tomcat;
access_log /data/syct/nginx/logs/merchant.access.log main;
error_log /data/syct/nginx/logs/merchant.error.log info;
}
location /coffee-api/swagger {
root /data/syct/apache-tomcat-api; #如果网站根路径不同可以把root定义在location中
proxy_pass http://127.0.0.1:8081;
access_log /data/syct/nginx/logs/coffee.access.log main;
error_log /data/syct/nginx/logs/coffee.error.log info;
}
}