【发布时间】:2017-09-28 10:21:43
【问题描述】:
我在我的 ubuntu 服务器中使用 nginx 并使用此配置:
server {
listen 80;
server_name example.ir www.example.ir;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/user/project;
}
location /download {
rewrite ^/download$
http://example.ir/files/file.apk;
}
location /download/ {
rewrite ^/download/$
http://example.ir/files/file.apk;
}
location /files/ {
root /home/user/download/;
}
}
server{
listen 8585;
server_name example.ir www.example.ir;
location / {
include uwsgi_params;
uwsgi_pass unix:/run/uwsgi/project.sock;
}
}
我可以使用 IP (1.2.3.4:8585) 访问该站点(在 django 中),尽管它没有在 nginx 中设置(我知道它通过了 throw nginx,因为它显示在 nginx 访问日志中!),但我不能用域名访问! (超时) 唯一可以同时使用 ip 和域名的端口是 80 和 8080!!!其他端口不工作。
我为 dns 使用 cloudflare 服务。
感谢您的帮助。
【问题讨论】:
标签: nginx dns cloudflare