Noob trying to configure an nginx

Hello,

Currently I’m using rancher 1.x for on my work and I have being migration to rancher 2x.
I used the migration tools to create my yaml files, and for each application it created 2 files, one deployment and one service.

When adding the service files on rancher 2.x it created each Service with a Cluster Ip, the Port Mapping was created with Publish Service port as my Rancher 1x Public Host Port and the target Port as my rancher 1.x Private Container Port

But, Currently I’m using Nginx for the applications on different versions and locating them by environment/stack for each application, the following is an exemple of my current nginx.conf

user nginx;

worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {

server {
listen 80;

  #Aplication version 1
   location /environment1/applicationStack{
       proxy_pass http://<ipAdress for environment1 host>:3000/;
   }

  #Aplication version 2
   location /environment2/applicationStack{
       proxy_pass http://<ipAdress for environment2 host>:3000/;
   }

   #rancher
   location /rancher {
       rewrite ^([^.]*[^/])$ $1/ permanent;
       rewrite ^/rancher/(.*)$ /$1 break;
       proxy_pass      http://<ipAdress for enviroment with nginx>:8080;
       proxy_redirect  off;
       proxy_set_header Host $host;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   }

}
}

So for example if I wanted to connect to each application it would be the rancherDNS:8080/environmentVersion/stackName
I’m having a hard time to understand how could I migrate this to rancher 2.X or if I would need to reconfigure everything. How should I configure the nginx file? should I use each service ClusterIp with the target port? or the Publish port? Or this ClusterIp is not even what I should configure?

Another thing is that we currently use CI with Travis, if Travis published a new pod in a deployment, this would not affect my service, right?

Do you find solution to this problem ? Facing the same issue here :grin:

I ended up installing helm in my machine,
connecting to my cluster
and configuring an rancher nginx-ingress-controller

with this I was able to create Ingresses,
Then I created an load balancer on AWS with an DNS,
the ingress received this DNS and I created the external pathes for each workload.