Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to strip upstream_db_path from package urls #20

Open
joshgordon opened this issue May 4, 2016 · 0 comments
Open

Fail to strip upstream_db_path from package urls #20

joshgordon opened this issue May 4, 2016 · 0 comments

Comments

@joshgordon
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant