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;
}
}
谢谢!