Skip to content

Instantly share code, notes, and snippets.

@abom
Created February 20, 2020 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abom/09acd468f5f690c6dc933424711bdeca to your computer and use it in GitHub Desktop.
Save abom/09acd468f5f690c6dc933424711bdeca to your computer and use it in GitHub Desktop.
from Jumpscale import j
class Package(j.baseclasses.threebot_package):
def start(self):
for port in (443, 80):
website = self.openresty.get_from_port(port)
locations = website.locations.get(name=f"unlock_service_{port}_locations")
include_location = locations.get_location_custom(f"unlock_service_includes_{port}")
include_location.config = f"""
location /threefoldfoundation/unlock_service {{
rewrite /threefoldfoundation/unlock_service/(.*)$ /threefoldfoundation/unlock_service/actors/unlock_service/$1;
}}"""
locations.configure()
website.configure()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment