<p>I have my assets on s3 and my service is deployed on kubernetes. Is it possible to define proxy pass in nginx-ingress. My current nginx proxy_pass assets to s3 and I want to replicate in kubernetes.</p>

<pre><code>location /assets/ {
          proxy_pass https://s3.ap-south-1.amazonaws.com;
   }
</code></pre>

<p>I tried this but its not working</p>

<pre><code>nginx.ingress.kubernetes.io/server-snippet: |
      location /assets/ {
              proxy_pass https://s3.ap-south-1.amazonaws.com/assets/;
      }
</code></pre>

<p>You can try to use service of type ExternalName here like that:</p>

<pre><code>kind: Service
apiVersion: v1
metadata:
  name: s3-ap-south
spec:
  type: ExternalName
  externalName: s3.ap-south-1.amazonaws.com
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: s3-ingress
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
    nginx.ingress.kubernetes.io/ssl-passthrough: "true"
spec:
  rules:
  - host: YOUR_HOSTNAME
    http:
      paths:
      - backend:
          serviceName: s3-ap-south
          servicePort: 443
</code></pre>
