1
我在我的django(gunicorn)應用程序前面運行nginx。我要撥打的電話:將nginx中的子域url重寫爲後端服務器
api.mydomain.com
被重定向到:
本地主機:8080/API
我現在有這個,但是這顯然沒有按't work:
server {
listen 80;
server_name api.mydomain.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
location/{
index index.html index.htm;
proxy_pass http://localhost:8080/api;
}
}
謝謝!