diff --git a/netbox/core/data_backends.py b/netbox/core/data_backends.py index 15891a6f5..2d3a7d8c8 100644 --- a/netbox/core/data_backends.py +++ b/netbox/core/data_backends.py @@ -149,7 +149,8 @@ class S3Backend(DataBackend): region_name=self._region_name, aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key, - config=self.config + config=self.config, + endpoint_url=self._endpoint_url ) bucket = s3.Bucket(self._bucket_name) @@ -176,6 +177,11 @@ class S3Backend(DataBackend): url_path = urlparse(self.url).path.lstrip('/') return url_path.split('/')[0] + @property + def _endpoint_url(self): + url_path = urlparse(self.url) + return url_path._replace(params="", fragment="", query="", path="").geturl() + @property def _remote_path(self): url_path = urlparse(self.url).path.lstrip('/')