pywb
pywb copied to clipboard
Custom value for host_prefix variable
Is it possible to set the host_prefix variable when rewriting HTML with a custom value?
Currently using the following setup.
PYWB in docker container. Sits behind a nginx reverse proxy in another docker container. Both containers are deployed using docker compose.
Rewriting URLs in HTML content contain the internal docker compose network address when requests are sent to PYWB using reverse proxy. Internal network address is not accessible outside of docker.
Would like to force a specific value for host_prefix for the domain of the nginx reverse proxy.
@monstrfolk It seems to be container hostname assignment issue rather than pywb issue.
using nginx's proxy_pass running in front end container to forward requests to pywb docker container in the backend using the pywb docker image to browse current archives either with ip address or hostname works for me, but to use the hostname in proxy_pass I had to run the docker with --hostname argument and update /etc/hosts file in frontend container with the backend container hostname to be able to access backend container using hostname instead of ip address.
If you provide your docker composer and pywb yaml files I will try it.
@sydoluciani trying to make a request from a container to another container, both part of the same docker-compose. Both containers are part of same domain with a proxy container sitting in front of both. For example, domain.com proxies requests to either domain.com/api_container or domain.com/pywb_container by matching subfolders. This issue is when api_container makes a request to pywb_container. Container to container requests are using docker internal network and are referenced by the container name and internal docker port. All rewritten URLs from pywb contain the internal docker details.
The internal path pywb_container:8180/* needs to be domain.com/pywb_container/*