测试 安装了Nginx 1.12 + Tomcat7 成功新建了一个站点:
- server
- {
- listen 80;
- listen 443 ssl;
- server_name dev.phxtec.com;
- index index.php index.html index.htm default.php default.htm default.html;
- root /www/wwwroot/mstw;
- #error_page 404/404.html;
- ssl_certificate /etc/letsencrypt/live/dev.phxtec.com/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/dev.phxtec.com/privkey.pem;
- if ($server_port !~ 443){
- rewrite ^/.*$ https://$host$uri;
- }
- error_page 497 https://$host$uri;
- error_page 404 /404.html;
- error_page 502 /502.html;
-
- #TOMCAT-START
- rewrite ^/mstw/(.*)$ /$1 break;
- expires 12h;
-
-
- if ($uri !~ ".*\.php$")
- {
- rewrite /mstw/(.*)$ /mstw/$1 break;
- rewrite /(.*)$ /mstw/$1 break;
- }
-
- location /mstw
- {
- proxy_pass "http://127.0.0.1:8080";
- proxy_cookie_path /mstw /;
- proxy_cookie_path /mstw/ /;
- sub_filter /mstw "";
- #sub_filter_types text/html;
- sub_filter_once off;
- }
- #TOMCAT-END
-
- access_log /www/wwwlogs/dev.phxtec.com.log;
- }
复制代码 但是建立第二个站点后,失败,能建立站点,但是无法找到资源
|
|