Category: Uncategorized

1

How to fix Rancher 2.0 “503 Service Temporarily Unavailable”

Scenario

So you have your Rancher 2.0 Kubernetes cluster up, and you update one of your apps.. Suddenly your site is down and you see the error

503 Service Temporarily Unavailable

Don’t freak out, theres a simple solution here. More likely than not, you setup your ingress to target a backend instead of a service.

Updating your app can often rename the ‘backend’, causing your initial ingress to be at a loss about what to point to.

Solution

Edit your app, expose the port as a Cluster IP and then edit your ingress to be a service which targets the exposed port.

How to fix django cors issue 0

How to fix django cors issue

create a file middleware.py and type

class CORSMiddleware:

    def __init__(self, get_response):
        self.get_response = get_response

    def __call__(self, request):
        response = self.get_response(request)
        response['Access-Control-Allow-Origin'] = "*"
        return response

In settings.py

add

MIDDLEWARE = [
    ...
    'product.middleware.CORSMiddleware',
]