浏览器开始下载文件而不是页面呈现

时间:2015-02-13 08:33:48

标签: java tomcat websocket spring-websocket

由于我们使用WebSocket功能部署了应用程序,因此我们发现了以下问题:

一旦5-10页重新加载而不是新页面,浏览器开始下载短(2字节)文件。问题似乎是随机的。

这个问题并没有出现在"裸露的" Tomcat部署。

我们的筹码是:

  • 操作系统:CentOS 6.6版(最终版)
  • Tomcat的
  • Apache:2.4.6
  • proxy_wstunnel 2.4.6
  • Java:java版本" 1.7.0_72"
  • Grails 2.4.4
  • 弹簧的WebSocket:1.2.0

httpd.conf

<VirtualHost *:80>
    ServerName my.application.com
    Redirect / https://my.application.com
</VirtualHost>

<VirtualHost *:443>
    DocumentRoot /var/www/html
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{request_uri} [R=301,L]
    ServerAdmin webmaster@datacave.ch
    SSLEngine on
    SSLCertificateKeyFile my.application.com.key
    SSLCertificateFile my.application.com.crt
    SSLCertificateChainFile sub.class4.server.ca.pem
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    ServerName my.application.com
    ServerAlias application1.application.local
    ErrorLog /var/www/logs/application/application-error_log
    CustomLog /var/www/logs/application/application-access_log combined
    <FilesMatch "\.(eot|woff|ttf|otf|svg)">
        <IfModule mod_headers.c>
            SetEnvIf Origin "http(s)?://(.+\.)?(application.com|application.local)$" AccessControlAllowOrigin=$0$1
            Header set Access-Control-Allow-Origin "*"
            Header set Access-Control-Allow-Credentials true
        </IfModule>
    </FilesMatch>
    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>
    SSLProxyEngine          Off
    ProxyRequests           Off
    ProxyPass               /       ajp://application1.application.local:8009/
    ProxyPassReverse        /       ajp://application1.application.local:8009/
</VirtualHost>

server.xml中

<Connector port="8009" protocol="org.apache.coyote.ajp.AjpNioProtocol" redirectPort="8080" URIEncoding='UTF-8'/>

如何解决?

0 个答案:

没有答案