Nginx 网站可以在本地主机上运行,但不能在 IP / 域名上运行

问题描述 投票:0回答:2

我正在尝试将本地主机上的 nginx 网站连接到我的 IP 和域名。我已经使用“A”记录将我的域名连接到我的 IP。我的配置文件如下所示:

server {
  listen 80 default_server;
  listen [::]:80 default_server;
  root /var/www/enormouz.codes;
  index index.html;
  server_name enormouz.codes www.enormouz.codes;
  location / {
    try_files $uri $uri/ =404;
  }

有什么办法可以解决这个问题吗?

ubuntu nginx redirect ip nginx-config
2个回答
0
投票

您可以使用 https://github.com/Storken/webhost-setup 进行简单设置。删除当前的配置文件,这样就不会有冲突。


© www.soinside.com 2019 - 2024. All rights reserved.