-
Notifications
You must be signed in to change notification settings - Fork 654
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
Sinopia with Nginx and Proxy #335
Comments
I've encountered the same issue. It would be great if those resources were specified in a relative way, so we could take advantage of nginx features such as SSL, buffering, and HTTP auth. |
Hi @deleted, let me clarify something about my http proxy setup. [sinopia server] ==> [my machine] - no proxy exists between the two machines, they are on the same network.
|
I had the some similar issues, maybe youre not serving the assets (which are located in I also had the problem of running nginx with ssl, and node with http. Sinopia thought I was running http and generated links with http. I fixed this by putting this line in
Everything worked great after that. |
@trentearl Awesome! That was the setting I was looking for. Fixed both the web UI assets and the package URLs. @lordakshaya I think adding an |
@trentearl this is great. I have got the web interface and npmjs registry look up working. Thank you so much. I still face one issue, some of my NPM modules are coming from github (thru |
@lordakshaya I wish I could help, but I dont know. We arent using github. |
@trentearl ok no problem. @rlidwka does sinopia support caching npm modules coming in from git? |
It's an easy fix, but it modifies the sinopia repo // for nginx proxy
if (process.env.VIRTUAL_HOST) {
app.enable('trust proxy');
} There's a pull request pending, and it's been addressed here: #232 I use a fork of sinopia with docker https://hub.docker.com/r/rnbwd/sinopia/ intended to be used in front of a proxy - but I'd recommend forking your own repo or using the fork from the pull request at the moment - this is just a patchwork fix, and I'd like to try and contribute to this repo.. but it's an extremely complex express app and I found it difficult to modify the config.yaml (although I might have got it to work). The |
Sorry for dredging up an old thread, but I'm having trouble with getting the reverse proxy to work at all. I can get sinopia to serve the css/js files in browser without changing the If I use sinopia on the same machine (i.e. installing npm modules on the server, which fetches over localhost), it works - this is only an issue when making an external machine tries to access sinopia packages via the nginx proxy. I know the tgz requests get sent to sinopia, because it results in the sinopia-style 404 ( Here's my nginx config:
|
if you're using https I realized I needed to make this adjustment locally
But if the nginx proxy is on a different machine than sinopia - my method won't help. I'm a little confused about your setup - but I'm hosting everything in the cloud - not localhost, and I use the docker nginx-proxy container on the same server as sinopia - and the configuration is just created on the fly, so I don't actually write any nginx code (or I haven't since the repo stabilized). But how do you know that sinopia is receiving the packages if it's giving a 404? edit: you can test it here: https://synctea.com you have to disable strict-ssl locally to use it - I'm just hosting it on a $5 digital ocean - curious if the same error happens. (it's legit https I don't know why npm doesn't accept it - git / curl / browsers work fine) |
actually yeah my server just pooped trying to download a hyperfs - i don't think sinopia (at least with the current npm) resolves all the paths to repos with more diverse assets |
Any news for nginx and I'm using nginx for https connections to my server. |
I've setup my sinopia service behind nginx proxy with SSL/TLS. I stumbled on this post when trying to resolve it. Not sure if my configuration will help you or not, but here they are. NGINX conf
Sinopia Conf
|
Right now, I'm thinking a lot about security questions. Two years ago this
|
Personally, I think security should be on everyone's mind! It blows my mind how many sites on the web aren't using SSL. I was on a site the other day looking to make a purchase and when I got to the payment workflow they weren't using SSL. Yeah, right, I'm going to put my personal information, along with my credit card info, in plain text over the wire!! HaHaHa! Needless to say, they didn't get my business. I actually read this article yesterday on how Google is changing up the insecure warning message on the chrome browser. I had to explain this subtle "nuance" to a friend of mine (not very technical), not too long ago: Green lock = GOOD. Red X = BAD! IMO, code repositories (Gitlab, Docker Registry, NPM/Sinopia, etc.) should always be pretty locked down. Inside the corporate setting, this is a must, and depending on the industry, it could very well be a hard set rule, like PCI compliance standards. As far as Security behind nginx goes, I dont see why it would be a problem, but then again, I'm not exactly an NGINX (or security for that matter) expert. |
I actually influenced nginx-proxy to adopt ssl. When I first started using it, it was only an http proxy, so I forked it and added ssl, and we discussed it in issue's like this (and ultimately my syntax is was the one that was adopted 😆) but this article - https://www.lvh.io/posts/dont-expose-the-docker-socket-not-even-to-a-container.html - which i found from the awesome container list is what I'm curious about. Does nginx proxy expose the docker socket??? (this is probably most appropriate to ask on that repo). Because I am not an expert either.. |
Hi,
I have setup a Sinopia server with Nginx installed on it. My nginx configuration looks like this:
and my sinopia server is running via pm2 =>
pm2 start
which sinopia-f
. Lastly, my config yaml is a copy of https://github.com/rlidwka/sinopia/blob/master/conf/full.yaml (with web version enabled).I am facing 2 problems:
npm set registry http://SERVER_URL/sinopia
but after that when I runnpm install <module_name>
e.g. "qs", it fails! The verbose error log is:Can you please suggest what should I do?
The text was updated successfully, but these errors were encountered: