Created
February 20, 2020 14:22
-
-
Save abom/09acd468f5f690c6dc933424711bdeca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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