Skip to content

How to setup multiple Ingresses for the same domain but with different ports #4480

Closed Answered by jasonwilliams14
hahahannes asked this question in Q&A
Discussion options

You must be logged in to vote

@hahahannes You can use snippets to add another port to the virtualServer. You can use something like the following:

apiVersion: k8s.nginx.org/v1
kind: VirtualServer
metadata:
  name: cafe
spec:
  host: cafe.example.com
  tls:
    secret: cafe-secret
  server-snippets: |
    listen 8081;

That will add 8081 to the cafe.example.com server block.

The full example:

apiVersion: k8s.nginx.org/v1
kind: VirtualServer
metadata:
  name: cafe
spec:
  host: cafe.example.com
  tls:
    secret: cafe-secret
  server-snippets: |
    listen 8081;
  upstreams:
  - name: tea
    service: tea-svc
    port: 80
  - name: coffee
    service: coffee-svc
    port: 80
  routes:
  - path: /tea
    action:
      pa…

Replies: 1 comment 19 replies

Comment options

You must be logged in to vote
19 replies
@hahahannes
Comment options

@brianehlert
Comment options

@hahahannes
Comment options

@jasonwilliams14
Comment options

Answer selected by jasonwilliams14
@hahahannes
Comment options

@hahahannes
Comment options

@hihoak
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants