2017-10-19 27 views

Répondre

0

Dans votre configuration nginx, ajoutez quelque chose comme ça. Cela passe toutes les demandes sur api.website.com à votre socket gunicorn -> votre application django.

server { 
    listen *:80; 
    server_name api.website.com; 

    location ~ ^/api(.*)$ { 
     try_files $uri $1 /$1; 
    } 

    location/{ 
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
     proxy_set_header X-Forwarded-Proto $scheme; 

     proxy_set_header Host $http_host; 
     proxy_redirect off; 

     proxy_pass http://gunicorn_socket/; 
    } 
}