Support base URLs with subdirectories
I have a couple other website-related services running on my server, and I would like them all available as subdirectories of https://api.example.com
- i.e. I want Commento to be available under https://api.example.com/comments
. Attempting to do so results in a 404 error.
I use an Nginx reverse proxy, and the configuration is the same as a working configuration on the root of a domain, e.g. https://comments.example.com
, except the location
block is /comments
instead of /
. /comments/
also does not work.
If I add a rewrite ^/comments/?(.*)$ /$1 break;
line in the location
block, I get redirected to https://api.example.com/login
, which leads me to believe Commento is ignoring the subdirectory on the base URL when it generates URLs or it is just sending /login
as the redirect URL. My guess is the latter, given my experience with #59 (closed) as well.
I'm thinking Commento should either send absolute URLs (https://example.com/...
instead of /...
) or, if the domain shouldn't be there for some reason, extract the subdirectory from the base URL so it returns /comments/...
instead of /...
.
As a side note, is there a specific reason for using root-relative links, if that's how Commento does it?