【发布时间】:2018-08-27 18:13:08
【问题描述】:
我将 Apache2 设置为 Tomcat 的反向代理。我在 Tomcat 中的 server.xml 有下一个 AJP 配置:
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
Apache 的配置是:
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPreserveHost On
SSLProxyEngine On
SSLEngine On
SSLCertificateFile /home/xxxxxx/store/f******.pem
SSLCertificateKeyFile /home/xxxxxx/p*******.pem
# Servers to proxy the connection, or
# List of application servers Usage
ProxyPass / ajp://localhost:8009/x/
ProxyPassReverse / ajp://localhost:8009/x/
ServerName localhost
</VirtualHost>
我的网络应用正在使用 Spring Security。 目前 Apache 服务页面(jsp)很好,但没有静态资源。不可能达到任何资源。 如果我放入浏览器
https://example.com/x/resources/img/logo.jpg
我看不到徽标。但是如果我把
https://example.com:8443/x/resources/img/logo.jpg
它出现了。
我们将非常欢迎任何帮助。
在此先谢谢大家 ;-)
【问题讨论】:
标签: tomcat apache2 reverse-proxy