我在反向代理配置下运行 apache 来提供 java webapp 内容
<VirtualHost *:80>
SSLProxyEngine on
ProxyPreserveHost On
ProxyRequests Off
ServerName www.example.com
ServerAlias example.com
<Location />
Order deny,allow
Allow from all
SetOutputFilter INFLATE;DEFLATE
ProxyPass http://localhost:7070/
ProxyPassReverse http://localhost:7070/
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
</Location>
</VirtualHost>
现在我想添加静态文件夹,并且应该在相同的域名下但在“/auth”路径下提供服务 https://example.com/auth
所以我在上面的下面添加了下面的配置
<Location /auth>
Require all granted
Allow from all
</Location>
Alias "/auth" "/var/www/html/auth"
DocumentRoot /var/www/html/auth/
<Directory /var/www/html/auth>
Require all granted
DirectoryIndex index.html
</Directory>
但是当我尝试“https://example.com/auth”时,它仍然会转到 java webapp 并给我 404。但是当我 curl localhost 我可以看到网页内容
curl http://localhost
如何使用 https://example.com/auth URL访问 /var/www/html/auth/ 上的静态内容