Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
change webroot possible
#1
Hi,

I would like to change the webroot from / to /sip
Is this possible by config?  I have seen urls.py but changing that seems to be not update proof. Hopefully it can be done without external components.

The reason I ask this is that I'm busy protecting all my services and placing them behind a reverse proxy and use Keycloak for authorization (openid-connect) and 2FA. SIP is one of the last to do and having the services at a separate root would be very helpful.

Thanks,
Gerard
Reply
#2
Hi Gerard,

You might find the answer in the Web.py docs:
http://webpy.org/cookbook/url_handling

Especially check the web.ctx reference.
Reply
#3
Thanks Dan,

As far as I can see it is quit a bit of work to do this. I hoped it could be done with some minor config changes.

For now I will try to remap the urls by the proxy.
Reply
#4
Lightbulb 
For those who are interested in this topic (if any Wink ). 

Changing the webroot via a reverse proxy is easy. Hints are already in ReverseProxied.py.
In this case I use Nginx with the following few lines of config. 

Code:
location /sip {
               proxy_pass http://<ip of sip>:<port>;
               proxy_set_header Host $host;
               proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
               proxy_set_header X-Forwarded-Proto $scheme;
               proxy_set_header X-Script-Name /sip;
               }
location /sip/static {
               proxy_pass http://<ip of sip>:<port>/static;
               proxy_set_header Host $host;
               proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
               proxy_set_header X-Forwarded-Proto $scheme;
               proxy_set_header X-Script-Name /sip/static;
               }
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)