You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 1, 2021. It is now read-only.
I just bumped into a little snag trying to use Verdaccio in an environment where it is reverse-proxied with a url_prefix. I thought I'd document what I found; hopefully this is helpful!
Because both of these instances are the same version, it conceals an underlying issue: that setting a url_prefix in Verdaccio v4's config.yaml doesn't lead to the url_prefix being used for the accompanying static assets.
reproduction
git clone https://github.com/verdaccio/docker-examples.git verdaccio-docker-examples
cd verdaccio-docker-examples/reverse_proxy/nginx/relative_path/
docker-compose build
docker-compose up
This starts Verdaccio instances at / (v4), /verdaccio/ (v4), and /verdacciov3/ (v3). They all look and operate fine.
However, the source code in the /verdaccio/ instance refers to assets using URLs beginning with /, rather than /verdaccio/ as specified in the url_prefix:
When I access /verdaccio/, I see log entries from both the verdaccio_relative_path_v4 and verdaccio_relative_path_v4_root containers.
If I then disable the verdaccio_relative_path_v4_root container and refresh the browser, the /verdaccio/ page turns white, and the browser developer tools show these resources failed to load. The instance at /verdacciov3/ continues functioning unaffected.
why's this an issue?
In my use case, I need to confine Verdaccio completely to a subdirectory using url_prefix, so serving the static assets from the the root of the domain is unfortunately not feasible.
I can confirm that the resources load properly when I revert that change, or add ToReplaceByVerdaccio/ manually to the three imports in verdaccio-ui's static/index.html. Unfortunately, simply reverting isn't possible because that would reintroduce https://github.com/verdaccio/ui/issues/108.
Hello,
I just bumped into a little snag trying to use Verdaccio in an environment where it is reverse-proxied with a
url_prefix
. I thought I'd document what I found; hopefully this is helpful!summary
In the nginx reverse proxy example with a relative path, the Verdaccio instance at
/verdaccio/
points to the static assets served by the instance at/
.Because both of these instances are the same version, it conceals an underlying issue: that setting a
url_prefix
in Verdaccio v4'sconfig.yaml
doesn't lead to theurl_prefix
being used for the accompanying static assets.reproduction
git clone https://github.com/verdaccio/docker-examples.git verdaccio-docker-examples cd verdaccio-docker-examples/reverse_proxy/nginx/relative_path/ docker-compose build docker-compose up
This starts Verdaccio instances at
/
(v4),/verdaccio/
(v4), and/verdacciov3/
(v3). They all look and operate fine.However, the source code in the
/verdaccio/
instance refers to assets using URLs beginning with/
, rather than/verdaccio/
as specified in theurl_prefix
:When I access
/verdaccio/
, I see log entries from both theverdaccio_relative_path_v4
andverdaccio_relative_path_v4_root
containers.If I then disable the
verdaccio_relative_path_v4_root
container and refresh the browser, the/verdaccio/
page turns white, and the browser developer tools show these resources failed to load. The instance at/verdacciov3/
continues functioning unaffected.why's this an issue?
In my use case, I need to confine Verdaccio completely to a subdirectory using
url_prefix
, so serving the static assets from the the root of the domain is unfortunately not feasible.related issues
See: #10
See: verdaccio/verdaccio#1299, verdaccio/verdaccio#1297
Many thanks,
Braxton
The text was updated successfully, but these errors were encountered: