Skip to content

Fail to strip upstream_db_path from package urls #20

Open
@joshgordon

Description

@joshgordon

Hello,

The NPM mirror that I'm using has a /npm at the end of the url, so I used upstream_db_path in the config.json to make it work. However, when npm-lazy-mirror proxies back the URLs for the packages, it doesn't strip the /npm out, causing them to 404.

I devised a temporary workaround using nginx (since I'm reverse proxying through that anyways) as follows:

server {
  listen 8080;
  location / {
    proxy_pass http://localhost:20000;
  }
  location ~* /npm(/.*) {
    return 301 $1;
  }
}

The proxy should strip the upstream_db_path from the path to the packages before pushing to the client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions