【发布时间】:2018-07-23 18:59:25
【问题描述】:
我正在使用 nginx、ubuntu 14、gunicorn、django 1.11、python 2.7。
我已在 django 的设置中将我的域放在 Allowed_HOSTS 中。
这是我在可用站点下的内容:
server {
listen 8000;
listen 80;
server_name IP domain.com;
location /static/ {
root /home/username/website/src;
}
location / {
include proxy_params;
proxy_pass http://unix:/home/username/website/website.sock;
}
}
【问题讨论】:
-
您需要编辑
/etc/hosts以将站点重定向到特定的IP地址。 -
@WillemVanOnsem 喜欢这个?
IP domain.com -
@WillemVanOnsem 你有什么好的资源或教程吗?因为我找不到任何东西可以帮助我学习如何将域名连接到我的 IP。
-
我认为这可能是一个开始:unix.stackexchange.com/q/36009
-
@WillemVanOnsem /etc/hosts 似乎没有做任何事情。我可能还缺少其他东西。
标签: python django nginx ubuntu-14.04