2016-04-21 119 views
1

我想重定向目錄下的所有交通(tomcat Webapps目錄)到https,除了一個應用程序以外的所有。問題是,我的Tomcat 7的過濾器下的所有交通/以https,但前一個異常被忽略......排除目錄安全 - Contraint

下面的例子爲我/tomcat7/conf/web.xml

> <security-constraint> 
>  <web-resource-collection> 
>   <web-resource-name>app1</web-resource-name> 
>   <url-pattern>/webservice/*</url-pattern> 
>  </web-resource-collection> 
> </security-constraint> 
> 
> <security-constraint> 
>  <web-resource-collection> 
>   <web-resource-name>Protected Context</web-resource-name> 
>   <url-pattern>/*</url-pattern> 
>  </web-resource-collection> 
>  <user-data-constraint> 
>   <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> 
> </security-constraint> 

哪有我添加了一個例外去與http和所有其他流量與https?

+0

你爲什麼要修改'conf/web.xml'?這是所有已部署應用程序的系統範圍默認配置。我想你可能想單獨配置每個應用程序。 –

回答

1

嘗試在不希望https的地方添加<transport-guarantee>NONE</transport-guarantee>,告訴tomcat忽略該特定頁面。

+1

我已經嘗試過,但不工作,我已經嘗試過了 受保護的上下文 /* CONFIDENTIAL app1 /cd_webservice_preview/* <運輸保障>無 ' 不過不要也不行 –