# NGINX configuration to redirect call correctly

**URL:** <https://forums.suse.com/t/nginx-configuration-to-redirect-call-correctly/10075>\
**Category:** Rancher 1.x\
**Created:** [April 13, 2018, 6:25am UTC](https://forums.suse.com/t/nginx-configuration-to-redirect-call-correctly/10075 "2018-04-13T06:25:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maramazza](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/maramazza/32/3912_2.png) [@maramazza](https://forums.suse.com/u/maramazza)\
**Post date:** [April 13, 2018, 6:25am UTC](https://forums.suse.com/t/nginx-configuration-to-redirect-call-correctly/10075/1 "2018-04-13T06:25:00Z")

</div>

Hello to all,  
I have a problem with the configuration of Nginx and Rancher … I hope someone can help me …  
Basically I can not reach the container using the public “name” but only using the private ip and the port that I have configured.  
I think it’s a problem of NGINX configuration but I do not understand where the problem is … Everything is redirected to the rancher …

My structure is as follows:

Virtual Machine 1 (with Public IP)  
Docker with 2 containers:  
NGINX and Rancher (with Load balancer (to redirect the various calls to the correct container))

Virtual Machine 2  
Docker with:

- Rancher Agent
- All the containers I need set up with correct VIRTUAL\_HOST and with correctly configured DNS records (example: container1 -\> cont1. XXX .com, container2 -\> cont2. XXX .com)

Nginx Configuration File: [https://pastebin.com/jkd2UTUi](https://pastebin.com/jkd2UTUi)

Thanks so much!
