-
Notifications
You must be signed in to change notification settings - Fork 690
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
private feeds via nginx reverse proxy (workaround) #515
Comments
You can also filter by IP as follow :
This is totally compatible with @jsiedentop's answer. NB : I had to increase the "proxy_max_temp_file_size" value for my usage. |
But how is it possible to authenticate when using the included symbol-server? It seems like Visual Studio has no built-in option to use password-protected symbol servers and it returns me a 401: Unauthorized. |
Hello! @jsiedentop @pierrediancourt can you present full docker-compose.yml and nginx conf files? I'm trying set up nginx and baget but when I send request to "/" I'm getting 502 Bad Gateway error from nginx... |
Hi @abakumov-v,
nginx config :
|
@pierrediancourt, It also works if your baget server in kubernetes. Without it, kubernetes resolves it's own virtual IP. But with your config, it works fine! |
Posting the required K8s manifest here just in case anyone wants to run this in kubernetes. Note: I SSL offload at a load balancer so the configuration is all over http, but it should simple enough to tweak for your own use case.
|
Thank you!
…On Wed, 20 Jan 2021 at 16:04, wojtek-viirtue ***@***.***> wrote:
Posting the required K8s manifest here just in case anyone wants to run
this in kubernetes.
Note: I SSL offload at a load balancer so the configuration is all over
http, but it should simple enough to tweak for your own use case.
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: baget-nuget-server-pvc
spec:
storageClassName: kadalu.replica3
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: baget-nuget-server
spec:
selector:
matchLabels:
app: baget-nuget-server
template:
metadata:
labels:
app: baget-nuget-server
spec:
containers:
- name: baget-nuget-server
image: loicsharma/baget:latest
env:
- name: ASPNETCORE_ENVIRONMENT
value: Releae
- name: ApiKey
value: XXXXXXXXXXXXXXX
- name: Storage__Type
value: FileSystem
- name: Storage__Path
value: /var/baget/packages
- name: Database__Type
value: Sqlite
- name: Database__ConnectionString
value: Data Source=/var/baget/baget.db
- name: Search__Type
value: Database
resources:
limits:
memory: "512Mi"
cpu: "500m"
ports:
- containerPort: 80
volumeMounts:
- mountPath: /var/baget/packages
name: baget-packages
volumes:
- name: baget-packages
persistentVolumeClaim:
claimName: baget-nuget-server-pvc
---
kind: Service
apiVersion: v1
metadata:
name: baget-nuget-server
spec:
selector:
app: baget-nuget-server
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 80
---
apiVersion: v1
data:
auth: XXXXXXXXXXXXXXX
kind: Secret
metadata:
name: basic-auth
type: Opaque
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-baget
annotations:
nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: basic-auth
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - Nuget Server'
kubernetes.io/ingress.class: nginx
spec:
rules:
- host: nuget.yourdomain.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: baget-nuget-server
port:
number: 80
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#515 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH2SKKECUIBCEH2J5KSA3KDS23IFPANCNFSM4M4XHJHQ>
.
|
Several people would like to run a private nuget feed. The depending pull request is open for 2 years now. It seems that this could take a while to be published. #69
I provide the baget service behind a nuget reverse proxy where nginx takes over the authentification part. In combination with docker compose this works quite well. I think this is a nice workaround as long the pull request is open.
The nginx site configuration:
creating the htpasswd file:
As many people didn't know how nuget auth works exactly it would be nice to add this way to the documentation. An all in one docker-compose file with nginx and baget would be awesome.
The text was updated successfully, but these errors were encountered: