This is great. I've thought proxying to nginx wasn't too desirable.
Would anyone happen to know how to do this with ingress nginx? I could do the regex for paths but I'm stuck on method and headers.
Anything about running your own Lemmy instance. Including how to install it, maintain and customise it.
Be sure to check out the docs: https://join-lemmy.org/docs/en/administration/administration.html
If you have any problems, describe them here and we will try to help you fixing them.
This is great. I've thought proxying to nginx wasn't too desirable.
Would anyone happen to know how to do this with ingress nginx? I could do the regex for paths but I'm stuck on method and headers.
Knock on wood, A fellow on reddit sent me CRDs for nginx.
I have not tested this- but, it might be a great starting point for you.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: lemmy
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 100m
nginx.ingress.kubernetes.io/limit-rps: "30"
nginx.ingress.kubernetes.io/limit-rpm: "600"
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
rules:
- host: example.com
http:
paths:
- path: /(api|pictrs|feeds|nodeinfo|.well-known)
pathType: Prefix
backend:
service:
name: lemmy
port:
number: 80
tls:
- hosts:
- example.com
secretName: lemmy-tls
***
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: lemmy-ui
annotations:
nginx.ingress.kubernetes.io/limit-rps: "30"
nginx.ingress.kubernetes.io/limit-rpm: "600"
spec:
rules:
- host: example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: lemmy-ui
port:
number: 80
tls:
- hosts:
- example.com
secretName: lemmy-tls
***
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: pictshare-redirect
annotations:
nginx.ingress.kubernetes.io/configuration-snippet: |
rewrite ^/pictshare(.*)$ /pictrs/image$1 redirect;
spec:
rules:
- host: example.com
http:
paths:
- path: /pictshare
pathType: Prefix
backend:
service:
name: pictrs
port:
number: 80
tls:
- hosts:
- example.com
secretName: lemmy-tls