[GH-ISSUE #107] Absolute vs. relative paths #93

Open
opened 2026-02-25 20:32:24 +03:00 by kerem · 2 comments
Owner

Originally created by @homlett on GitHub (Feb 19, 2017).
Original GitHub issue: https://github.com/asapach/peerflix-server/issues/107

The webui is broken when used behind a reverse proxy under a directory because of some absolute paths. For example, with this handy nginx configuration, it's not working:

location /peerflix/ {
        proxy_pass        http://127.0.0.1:9000/;
}

The webui looks for socket.io in https://domain.name/socket.io/socket.io.js instead of https://domain.name/peerflix/socket.io/socket.io.js. In index.html <script src="/socket.io/socket.io.js"></script> should be replaced by <script src="socket.io/socket.io.js"></script>

Same thing happens with paths to fonts in stylesheets and at least with /upload and /torrents

Originally created by @homlett on GitHub (Feb 19, 2017). Original GitHub issue: https://github.com/asapach/peerflix-server/issues/107 The webui is broken when used behind a reverse proxy under a directory because of some absolute paths. For example, with this handy nginx configuration, it's not working: ``` location /peerflix/ { proxy_pass http://127.0.0.1:9000/; } ``` The webui looks for socket.io in `https://domain.name/socket.io/socket.io.js` instead of `https://domain.name/peerflix/socket.io/socket.io.js`. In index.html `<script src="/socket.io/socket.io.js"></script>` should be replaced by `<script src="socket.io/socket.io.js"></script>` Same thing happens with paths to fonts in stylesheets and at least with `/upload` and `/torrents`
Author
Owner

@asapach commented on GitHub (Feb 19, 2017):

If you can get it to work for both relative and absolute urls, PR is welcome.

<!-- gh-comment-id:280949235 --> @asapach commented on GitHub (Feb 19, 2017): If you can get it to work for both relative and absolute urls, PR is welcome.
Author
Owner

@homlett commented on GitHub (Feb 19, 2017):

Honestly I never pulled anything because I'm not a real developer. However that looks doable and could be a good start. I'll try, but please be indulgent!

<!-- gh-comment-id:280953740 --> @homlett commented on GitHub (Feb 19, 2017): Honestly I never pulled anything because I'm not a real developer. However that looks doable and could be a good start. I'll try, but please be indulgent!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/peerflix-server#93
No description provided.