如何解决Apache中MP3文件的禁止错误?

发布于 2025-02-09 01:50:23 字数 1385 浏览 2 评论 0原文

我正在春季靴子上进行项目构建。因此,现在我正在尝试访问Apache Weberver Path/home/tomcat/webapps/example/web-inf/classes/static/public/public/public/example-content/chapter/chapter-chapter-1/audio/1.mp3上的mp3文件。但是我获得403状态,说禁止错误。我已经为端口443虚拟主机配置了我的项目,并授予文件夹和文件的所有权限。

以下是虚拟主机配置:

<VirtualHost *:443>
    ServerName example.com
    ServerAlias www.example.com
    
    SSLEngine on
    SSLCertificateFile /home/cert/example/ssl.cer
    SSLCertificateKeyFile /home/cert/example/private.key
    SSLCertificateChainFile /home/cert/example/caclient.cer
    DocumentRoot /home/tomcat/webapps/example
    <Directory /home/tomcat/webapps/example/WEB-INF/classes/static/public/example-content/Chapter-1/Audio>
        Options -Indexes +FollowSymLinks +MultiViews
        Options FollowSymlinks
        AllowOverride All
        Require all granted
    </Directory>
    
    ProxyRequests on
    ProxyPass / http://localhost:9111/example/
    ProxyPassReverse / http://localhost:9111/example/
    ProxyPassReverseCookiePath /example /
    ProxyPassReverseCookieDomain  example.com www.example.com
    RequestHeader set X-Forwarded-Proto "https"
    RequestHeader set X-Forwarded-Port "443"
</VirtualHost>

但是每次仍然会遇到相同的错误。我不知道我在哪里做错。如果您有任何建议或解决方案,请给我。

禁止错误的屏幕截图

I am working on a project build on spring boot. So now I am trying to access mp3 files deployed on apache webserver path /home/tomcat/webapps/example/WEB-INF/classes/static/public/example-content/Chapter-1/Audio/1.mp3. But I am getting 403 status saying forbidden error. I have configured my project for port 443 virtual host and given all permission to folders and files also.

Below is the virtual host configuration:

<VirtualHost *:443>
    ServerName example.com
    ServerAlias www.example.com
    
    SSLEngine on
    SSLCertificateFile /home/cert/example/ssl.cer
    SSLCertificateKeyFile /home/cert/example/private.key
    SSLCertificateChainFile /home/cert/example/caclient.cer
    DocumentRoot /home/tomcat/webapps/example
    <Directory /home/tomcat/webapps/example/WEB-INF/classes/static/public/example-content/Chapter-1/Audio>
        Options -Indexes +FollowSymLinks +MultiViews
        Options FollowSymlinks
        AllowOverride All
        Require all granted
    </Directory>
    
    ProxyRequests on
    ProxyPass / http://localhost:9111/example/
    ProxyPassReverse / http://localhost:9111/example/
    ProxyPassReverseCookiePath /example /
    ProxyPassReverseCookieDomain  example.com www.example.com
    RequestHeader set X-Forwarded-Proto "https"
    RequestHeader set X-Forwarded-Port "443"
</VirtualHost>

But still getting same error each time. I don't know where I am doing mistake. If you have any suggestions or solutions, please provide me.

Screenshot of forbidden error

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文