Welcome! Log In Create A New Profile

Advanced

nginx controller

Posted by picasso100 
nginx controller
June 16, 2021 06:23PM
I recently started to learn about K8S and nginx deployment.
Followed a turorial where two applications (.NET and Angular) are deploy using LoadBalancer (both applications are accessible with their respective external IPs)then tutporial walks you thru nginx ingress configuration (yaml below)

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: webapp-ingress
namespace: app
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- http:
paths:
- backend:
serviceName: webapp1-svc
servicePort: 80
path: /webapp1(/|$)(.*)
- backend:
serviceName: webapp2-svc
servicePort: 80
path: /webapp2(/|$)(.*)
- host: frontend.14.97.47.100.nip.io # change the IP address here
http:
paths:
- backend:
serviceName: webapp1-svc
servicePort: 80
path: /webapp1 //this is an angular app-does not work
- backend:
serviceName: webapp2-svc
servicePort: 80
path: /webapp2 //ASP app-opens fine

pointing browser to “http://frontend.14.97.47.100.nip.io/webapp1” does not produce any errors but the page is not displayed either.
is this due to the angular application? if so why does it work if configured as LoadBalancer?
Any direction is greatly appreciated.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 279
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready