Open nivinj opened 5 years ago
Probably fixed by accepting an environment variable for proxy endpoint, and using this to build the URL in CarterUrlExtensions.cs https://github.com/ai-traders/liget/blob/e50c365a59a14499fd7cbb233f1533f514fe8c2e/src/LiGet/Extensions/CarterUrlExtensions.cs#L50 https://github.com/ai-traders/liget/blob/e50c365a59a14499fd7cbb233f1533f514fe8c2e/src/LiGet/Extensions/CarterUrlExtensions.cs#L55
@nivinj Im using it behind a traefik proxy, which is working fine. Maybe you have to check the passed HTTP headers
I passing an env variable to use behind a proxy
docker run -ti -d --env https_proxy=http://myproxy.com
If you're using nginx, make sure you're passing the host header as well - since that's what LiGet uses to resolve the absolute URL
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
edit: just a reminder - clear your local nuget http cache if you update this, since nuget will cache the index.json file.
Anyone know how to do this via a kubernetes ingress-nginx config and route a subpath to the service?
I tried using a generic solution I see in other articles using the rewrite-target annotation to rewrite the url, but the returning xml document doesn't include the sub path.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: http-ingress
annotations:
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
ingressClassName: public
rules:
- host: mydomain.com
http:
paths:
- path: /nuget(/|$)(.*)
pathType: Prefix
backend:
service:
name: liget
port:
number: 9011
When running LiGet behind a reverse proxy, would be great if there was a way to specify the external URL to LiGet so it can be returned in the responses. In my case, I have LiGet running on
internalserver:9011
and I have apache reverse proxyingnuget.mycompany.com
tointernalserver:9011
.However in all the responses from Liget the internal (hidden) URL is used. e.g.:
{"version":"3.0.0","resources":[{"@id":"http://internalserver:9011/api/v2/package"...
Ideally should return:
{"version":"3.0.0","resources":[{"@id":"http://nuget.mycompany.com/api/v2/package"...