bonukai / MediaTracker

Self hosted media tracker for movies, tv shows, video games, books and audiobooks
MIT License
536 stars 23 forks source link

Site doesn't work at non-root URL #605

Open brownksc opened 2 months ago

brownksc commented 2 months ago

Mediatracker is working fine if I set up a reverse proxy in nginx to host it at the root directory (e.g., example.com) but not if I try to host it at a different directory (e.g., example.com/mediatracker).

This nginx config works as expected:

location / {
            proxy_pass http://127.0.0.1:7481;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }

This one does not:

location /mediatracker/ {
            proxy_pass http://127.0.0.1:7481/;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
        }

I tried this same config but with an Apache container (https://hub.docker.com/_/httpd):

docker run -dit --name my-apache-app -p 7481:80 -v "$PWD":/usr/local/apache2/htdocs/ httpd:2.4

And I'm able to access the Apache container's website with both nginx configs shown above. For some reason though, with mediatracker, only the first config works.

Any ideas?

Update: Just tried configuring a reverse proxy in Apache instead of NGINX. Same exact result, with root URL working fine and then mediatracker failing to display if I set it to some other URL. (/test/ for example).

Mediatracker will display a blank white page with the tag set to 'Media Tracker' when this error occurs.</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>