How to using nginx to handle requests to Kubernetes dashboard

1/17/2020

I have 2 host.
The first one is a nignx server listening on 443 and the IP address is ip1.
The other one is a Kubernetes server and the IP address is ip2.

Kubernetes dashboard address is ip2:31117
I have another app called app2 and it’s address is ip2:30180
The dashboard and app2 are both angular project.

I want nginx server to handle requests to dashboard and app2 as below:
dashboard: https://ip1:443/dashboard to ip2:31117
App2: https://ip1:443/app2 to ip2:30180

nignx configuration shows below:
location /dashboard {
   proxy_pass=https://ip2:31117
}

location /app2 {
    proxy_pass=http://ip2:30180
}

The index.html of each app can be loaded with this configuration. But the resources included in the index.html return 404. What should I do?

-- Ethan Hu
kubernetes-dashboard
nginx

0 Answers