【发布时间】:2021-09-21 07:30:20
【问题描述】:
我有一个在 Nginx 上运行的 AWS 服务器,它托管了一个在服务器上运行良好的 React 应用程序。 现在我希望在同一台服务器上可以使用用于 restframework 的 Django 应用程序。
我关注Document 并在服务器上上传了Django 应用程序,并尝试通过尝试python3 manage.py runserver 0.0.0.0:8000 来运行该应用程序。没有错误,但我无法使用http://server_domain_or_IP:8000 访问我的 ip。
/etc/nginx/conf.d/example.org.conf 中的 Nginx 配置
server {
listen 80 default_server;
server_name example.org;
return 301 https://example.org;
}
server {
listen 443 ssl;
server_name example.org;
ssl_certificate /etc/nginx/ssl/ssl_bundle.crt;
ssl_certificate_key /etc/nginx/ssl/example.key;
location / {
root /home/ubuntu/example/build;
index index.html index.htm;
}
}
请帮忙看看我哪里出错了?
【问题讨论】:
-
显示你的 nginx 设置。
-
嗨@RanuVijay,添加了Nginx配置
-
希望example.org是一个占位符,而不是实际的域名,否则,很明显是它没有指向你注册的域的问题。还有防火墙、关闭的端口、DNS 设置等等等等……
-
是的 example.org 仅用于演示目的。我对我的实时域进行了配置