# Using Nginx to handle kubernetes dashboard requests

**URL:** <https://discuss.kubernetes.io/t/using-nginx-to-handle-kubernetes-dashboard-requests/9343>\
**Category:** General Discussions\
**Created:** [January 17, 2020, 7:03am UTC](https://discuss.kubernetes.io/t/using-nginx-to-handle-kubernetes-dashboard-requests/9343 "2020-01-17T07:03:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ethan](https://avatars.discourse-cdn.com/v4/letter/e/8dc957/32.png) [@Ethan](https://discuss.kubernetes.io/u/Ethan)\
**Post date:** [January 17, 2020, 7:03am UTC](https://discuss.kubernetes.io/t/using-nginx-to-handle-kubernetes-dashboard-requests/9343/1 "2020-01-17T07:03:27Z")

</div>

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](https://ip1/dashboard) to ip2:31117   
  
App2: [https://ip1:443/app2](https://ip1/app2) to ip2:30180   
  
  
  
nignx configuration shows below:  
  
location /dashboard {  
  
&nbsp;&nbsp;proxy\_pass=https://ip2:31117   
  
}

location /app2 {  
  
&nbsp;&nbsp; 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?

---

<div class="post-metadata">

**Author:** ![tomasz.prus](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/tomasz.prus/32/6934_2.png) [@tomasz.prus](https://discuss.kubernetes.io/u/tomasz.prus)\
**Post date:** [January 17, 2020, 7:59am UTC](https://discuss.kubernetes.io/t/using-nginx-to-handle-kubernetes-dashboard-requests/9343/2 "2020-01-17T07:59:34Z")

</div>

Please try to add trailing slashes…

```auto
location /app2/ {
    proxy_pass http://ip2:30180/;
}

```

Nginx will remove the first uri part before sending it to the backend.

doc: [http://nginx.org/en/docs/http/ngx\_http\_proxy\_module.html#proxy\_pass](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass)
