【发布时间】:2016-09-05 13:07:31
【问题描述】:
我有 https://testsite.com 在 django + gunicorn + nginx + https 上工作。
我的 nginx 配置(一切正常):
server {
listen 80;
server_name testsite.com;
access_log off;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name *.testsite.com;
proxy_set_header X-Forwarded-Protocol $scheme;
# lots of sll staff
location / {
# point to gunicorn
proxy_pass http://176.112.198.254:8000/;
}
}
我需要在指向子目录的子域上实现城市(main_city 除外)。
所以我需要这样的网址:
https://testsite.com/some_url/ 应该指向https://testsite.com/main_city/some_url/ https://city1.testsite.com/some_url/ 应该指向 https://testsite.com/city1/some_url/ https://city2.testsite.com/some_url/ 应该指向 https://testsite.com/city2/some_url/
我该怎么做?
非常感谢帮助!
【问题讨论】:
-
Django multi tenancy的可能重复
-
@Sayse,没有关于 ssl 和 https
-
我更多地指的是该答案中包含的链接,该链接托管了为帮助支持此问题而制作的所有可能的软件包
标签: django nginx https gunicorn subdomain