<p>when I create my.yaml, then nginx will show failed (111: Connection refused) while connecting to upstream</p>

<p>have any sugesstion about this? Is there pod network do not connnect?</p>

<p>uwsgi:</p>

<pre><code>[uwsgi]
module          = myapp.wsgi
master          = true
processes       = 10
socket          = 127.0.0.1:8001
chmod-socket = 777
vacuum          = true
enable-threads = True
</code></pre>

<p>nginx:</p>

<pre><code>upstream django_api {
server 127.0.0.1:8001 max_fails=20 fail_timeout=10s;
}
server {
    listen 80;

    #location /media  {
    #    alias /media;  # your Django project's media files - amend as required
    #}
    location /static {
    alias /usr/share/apps/static; # your Django project's static files - amend as required
    }
    location / {
    uwsgi_read_timeout 60;
    uwsgi_pass  django_api;
    include     ./uwsgi_params; # the uwsgi_params file you installed
    uwsgi_param Host $host;
    uwsgi_param X-Real-IP $remote_addr;
    uwsgi_param X-Forwarded-For $proxy_add_x_forwarded_for;
    uwsgi_param X-Forwarded-Proto $http_x_forwarded_proto;
    }
</code></pre>

<p>}</p>

Frank Liao
<p>So just a thought, maybe set your uwsgi to <code>0.0.0.0:8001</code> then on your podSpec set container port values with just 8001:</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: mypod
  labels:
    component: web
spec:
  containers: 
    - name: django
      image: myimage
      ports:
        - containerPort: 8001
    - name: nginx
      image: nginx:alpine
      ....

</code></pre>

<p>this should make it available in localhost:8001/127.0.0.1:8001</p>
