【发布时间】:2018-06-17 13:24:12
【问题描述】:
我正在使用 Django 和 nginx 制作网站。(另外,uWSGI 和 AWS EC2...)
我已经为 IPv4 域设置了 nginx(http://123.45.67.89),所以我可以访问正确的索引页面。
但我不知道为什么我不能为域名(http://example.com)做到这一点!我可以访问 nginx 的“默认页面”(欢迎使用 nginx!)。
你能帮我做一个域名吗?
我的 Django 项目文件(根)是/home/ubuntu/proj/mysite
我的索引页在/home/ubuntu/proj/mysite/taxi/templates/taxi/index.html
我已经在 AWS Route 53 中设置了所有内容。
以下是我的/etc/nginx/sites-enabled/mysite
server {
listen 80;
server_name 123.45.67.89; #example
#access_log /var/log/nginx/log/mysite.access.log;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/ubuntu/proj/mysite;
}
location / {
root /home/ubuntu/proj/mysite;
index /taxi/templates/taxi/index.html; #location of index page
include /home/ubuntu/proj/mysite/uwsgi_params;
uwsgi_pass unix:/run/uwsgi/mysite.sock;
}
}
我不知道我给你展示什么来帮助我......
其实我不确定是不是nginx的问题。
【问题讨论】:
标签: python django amazon-web-services nginx