当前位置:论坛首页 > Linux面板 > 求助

如何在一台服务器上,发布多个 tomcat实例应用?

发表在 Linux面板2017-5-21 02:23 [复制链接] 0 1386

测试 安装了Nginx 1.12 + Tomcat7 成功新建了一个站点:
  1. server
  2. {
  3.     listen 80;
  4.         listen 443 ssl;
  5.     server_name dev.phxtec.com;
  6.     index index.php index.html index.htm default.php default.htm default.html;
  7.     root /www/wwwroot/mstw;
  8.     #error_page 404/404.html;
  9.     ssl_certificate    /etc/letsencrypt/live/dev.phxtec.com/fullchain.pem;
  10.     ssl_certificate_key    /etc/letsencrypt/live/dev.phxtec.com/privkey.pem;
  11.     if ($server_port !~ 443){
  12.         rewrite ^/.*$ https://$host$uri;
  13.     }
  14.     error_page 497  https://$host$uri;

  15.     error_page 404 /404.html;
  16.     error_page 502 /502.html;
  17.    
  18.     #TOMCAT-START

  19.         rewrite ^/mstw/(.*)$   /$1 break;
  20.         expires      12h;

  21.    
  22.     if ($uri !~ ".*\.php$")
  23.     {
  24.         rewrite /mstw/(.*)$    /mstw/$1 break;
  25.         rewrite /(.*)$    /mstw/$1 break;
  26.     }
  27.    
  28.     location /mstw
  29.     {
  30.         proxy_pass "http://127.0.0.1:8080";
  31.         proxy_cookie_path /mstw /;
  32.         proxy_cookie_path /mstw/ /;
  33.         sub_filter /mstw "";
  34.         #sub_filter_types text/html;
  35.         sub_filter_once off;
  36.     }
  37.     #TOMCAT-END
  38.    
  39.     access_log  /www/wwwlogs/dev.phxtec.com.log;
  40. }
复制代码
但是建立第二个站点后,失败,能建立站点,但是无法找到资源
使用道具 举报 只看该作者 回复
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

企业版年付运维跟进群

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急问题处理

论坛响应时间:10分钟

问题处理方式:1对1处理(优先)

工作时间:白班:9:00 - 18:00

工作时间:晚班:18:00 - 24:00

立即付费处理
快速回复 返回顶部 返回列表