zeratax / matrix-registration

a token based matrix registration api

Home Page:https://zeratax.github.io/matrix-registration/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support configurable base URL or use relative paths for static content

benqrn opened this issue · comments

Currently the built in web server only supports serving the registration page on the root of a given URL. There are absolute path references in <head>, in the form post action, and in the css, that prevent ProxyPass for example from properly serving the page from a path such as 'xyz.com/riot/register'.

A new config argument to specify the base URL path could be added, or simply removing the leading slash and using appropriate relative path references seems to work fine.

right that would be useful. I should test if just using relative paths already does the trick, since I remember it being kinda a pain to change the routes after the application started.

Currently I am just doing a rewrite for the demo version, but yeah that still relies on /static

 location ~ /test-register(.*)$  {
        rewrite ^ /register$1?$args break;
        proxy_pass http://localhost:5000;
        proxy_set_header X-Forwarded-For $remote_addr;
}

@benqrn okay that took forever for no reason, but try installing pip install matrix-registration==0.7.2.dev0 and setting base_url to e.g. /riot