jlesage / docker-firefox

Docker container for Firefox
MIT License
1.61k stars 288 forks source link

Problem with routing using URL path with NGINX #140

Closed emretapci closed 1 year ago

emretapci commented 1 year ago

I have followed the instructions in the README to set up a reverse proxy with routing based on URL path in NGINX, but when I navigate to https://hostname/firefox, the HTML response contains <link> tags that has an absolute URL path (starting with a slash) like  <link rel="manifest" href="/site.webmanifest?v=0ad20466ad">. This causes my browser to request https://hostname/site.webmanifest?v=0ad20466ad instead of https://hostname/firefox/site.webmanifest?v=0ad20466ad and get a 404 response from NGINX, because NGINX serves the app from /firefox URL. There are other <link> tags in the HTML response, that use a relative URL path like <link rel="preload" as="image" href="app/images/info.svg"> that causes my browser to request https://hostname/firefox/app/images/info.svg and resolve successfully. Since my browser cannot get the web manifest file (site.webmanifest), it cannot render the webpage.

I have attached the response index.html file. index.html.txt

jlesage commented 1 year ago

Are you using the latest version ? Version 22.10.3 should not have any absolute path.

emretapci commented 1 year ago

I am using the image with no tags, therefore latest is implied, I am not sure to which version tag it corresponds to. RepoDigest of the image is jlesage/firefox@sha256:cfee1b9583414f7f43a0701be8e25ac40d8851a444d6520e2d143f74a60254a7. I tried to use the tag V22.10.3, but it gave a manifest unknown error.

emretapci commented 1 year ago

I pulled the image with v22.10.3 tag, instead of V22.10.3 tag (with a lowercase v). Still, same issue.

jlesage commented 1 year ago

v22.10.3 is the same as latest. See https://hub.docker.com/r/jlesage/firefox/tags.

The RepoDigest of your image doesn't match... You can confirm the image version you are using with docker inspect <container name> | grep "org.label-schema.version". The version should also be clearly indicated in docker logs <container name.

emretapci commented 1 year ago

I made a clean pull and it worked. I am not sure what messed up with the images. Thanks.

jlesage commented 1 year ago

Great, good that it's working now.