<p>We have a platform built using microservices architecture, which is deployed using Kubernetes and Ingress. One of the platform's components is a Django Rest API. 
The yaml for the Ingress is the below (I have changed only the service names &amp; endpoints):</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: dare-ingress
  annotations:
    kubernetes.io/ingress.provider: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    certmanager.k8s.io/issuers: "letsencrypt-prod"
    certmanager.k8s.io/acme-challenge-type: http01
spec:
  tls:
  - hosts:
    - demo-test.com
    secretName: dare-ingress-tls
  rules:
  - host: demo-test.com
    http:
      paths:
      - path: /prov/?(.*)
        backend:
          serviceName: prov
          servicePort: 8082
      - path: /(prov-ui/?(.*))
        backend:
          serviceName: prov-ui
          servicePort: 8080
      - path: /flask-api/?(.*)
        backend:
          serviceName: flask-api
          servicePort: 80
      - path: /django-rest/?(.*)
        backend:
          serviceName: django-rest
          servicePort: 8000
</code></pre>

<p>The django component is the last one. I have a problem with the swagger documentation. While all the Rest calls work fine, when I want to view the documentation the page is not load. This is because it requires login and the redirection to the documentation does not work. </p>

<p>I mean that, without Ingress the documentation url is for example: <a href="https://demo-test.com/docs" rel="nofollow noreferrer">https://demo-test.com/docs</a> but using Ingress, the url should be <a href="https://demo-test.com/django-rest/login" rel="nofollow noreferrer">https://demo-test.com/django-rest/login</a> and then <a href="https://demo-test.com/django-rest/docs" rel="nofollow noreferrer">https://demo-test.com/django-rest/docs</a> but the redirection does not work, I get a 404 error.
Does anyone have any idea how to fix this in Ingress?</p>

sissythem
<p>I managed to fix the redirection error (and stay logged in) using the FORCE_SCRIPT_NAME as suggested in a comment in this <a href="https://stackoverflow.com/questions/58723145/hosting-django-on-aks-behind-nginx-ingress">thread</a> </p>

<p>However, now the swagger documentation is not properly loaded:</p>

<p><a href="https://i.stack.imgur.com/APvBG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/APvBG.png" alt="enter image description here"></a></p>

<p>I followed the suggestions from <a href="https://github.com/marcgibbons/django-rest-swagger/issues/758" rel="nofollow noreferrer">here</a> regarding the swagger documentation but still the page cannot be loaded properly. Any ideas?</p>
