Skip to content

[BUG] Trailing slash apache2 reverse proxy subpath #4126

@Crashillo

Description

@Crashillo

Describe the bug
Depending on the final trailing slash, the application will load successfully or not.

To Reproduce
FreshRSS is running under a subpath, and the following happens:
example.org/rss/ OK, freshrss redirects to example.org/rss/i/
example.org/rss FAIL, freshrss redirects to example.org/i/ and the <Location> apache directive doesn't match the path

Expected behavior
Both entries should load the application in the same way

Environment information (please complete the following information):

  • FreshRSS version: 1.19.1
  • Installation type: Docker (image freshrss/freshrss:arm)
  • Server: Apache 2.4

Additional context
Reverse proxy configuration file:

ProxyPreserveHost On

<Location /rss >
#  RewriteCond %{REQUEST_URI} /+[^\.]+$
#  RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]
  ProxyPass http://127.0.0.1:8079/
  ProxyPassReverse http://127.0.0.1:8079/
  ProxyPassReverseCookiePath  /  /rss/

  RequestHeader set X-Forwarded-Prefix "/rss"
  RequestHeader set X-Forwarded-Proto "https"

  Require all granted
  Options none
</Location>

If I uncomment the Rewrite lines it's even worst, as the example.org/rss/ becomes 403 Forbidden and example.org/rss still redirecting to example.org/i/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions