【发布时间】:2021-05-20 14:22:40
【问题描述】:
我有一个 react 构建,我在 vps 上的 nginx 服务器上提供服务,其中包含 contabo 和托管在 godaddy 上的域名。 我更改了godaddy 中的A 记录以指向我的vps ip 我将名称服务器从godaddys 切换到我的vps,它按应有的方式加载应用程序,但域名被替换为服务器的IP 地址。请告诉我如何解决这个问题
为 nginx 启用的站点是
server {
listen 443 ssl;
listen [::]:443 ssl;
include snippets/self-signed.conf;
include snippets/ssl-params.conf;
server_name blockface.fun;
root /var/www/blockface.fun/html;
index index.html;
access_log /var/log/nginx/blockface.fun.access.log;
error_log /var/log/nginx/blockface.fun.error.log;
location / {
#...
try_files $uri $uri/ /index.html$is_args$args;
#...
}
}
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
return 302 https://$server_name$request_uri;
}
当我运行 sudo ufw app list 时
Available applications:
Nginx Full
Nginx HTTP
Nginx HTTPS
OpenSSH
【问题讨论】: