<div dir="ltr"><div>Hi all,</div><div><br></div><div>I want to install an LNT server. For reasons that don't matter much I can't have something like</div><div><br></div><div>   <a href="https://lnt.dept.acme.org">https://lnt.dept.acme.org</a></div><div><br></div><div>but instead I can have</div><div><br></div><div>  <a href="https://dept.acme.org/lnt">https://dept.acme.org/lnt</a></div><div><br></div><div></div><div>I'm definitely not an expert in web applications nor WSGI but I managed to configure the front-end server (the one that serves <a href="http://dept.acme.org">dept.acme.org</a>) to proxy /lnt to the server that lnt runserver creates.<br></div><div><br></div><div></div><div>The problem I found is that the server started by "lnt runserver" is not aware that as a web application it is running under "/lnt", not under "/". This means the URLs rendered by the application are wrong.</div><div><br></div><div>I didn't find any obvious way to fix this so I amended lnt/lntool/main.py to accept a "--subdir" flag. I then wrapped the app just created using a "werkzeug.wsgi.DispatcherMiddleware" with the mount point specified in "--subdir"<br></div><div><br></div><div>Then I found another issue is that the https connection terminates at the front-end server and "lnt runserver" is again not aware of https. Sometimes the web application renders full URLs with http. Again I hacked lnt/lntool/main.py to accept a "--scheme" flag so I can wrap again the app, this time using a custom "middleware" that fixes the scheme.</div><div><br></div><div>With these two changes the web application seems to work fine :)<br></div><div><br></div><div>Has anyone run a similar setup? I feel my solution is a bit hacky, perhaps there is already a way to do this? Or else, it might be better to encode these two options in lnt.cfg?</div><div><br></div><div>Not sure if anyone would be interested in supporting this (perhaps unusual) scenario.<br></div><div><br></div><div>Kind regards,<br></div><div></div><div><br>-- <br><div class="gmail_signature">Roger Ferrer Ibáñez<br></div>
</div></div>