Remote nginx server refers to localhost

System Information
  • 4.5.3:
  • Ubuntu 22.04:
  • in config/databse.js - client: ‘sqlite’,:
  • 18.12.1:
  • 8.19.12:

Hello everyone, I was able to run my project on a remote server. However, when I try to go to the admin panel, which is located remotely, I see that it is trying to get to the localhost. Why?

Here is my config file /etc/nginx/sites-enabled/config

server {
     # Listen HTTP
     listen 80;

     # Redirect HTTP to HTTPS
     return 301 https://$host$request_uri;

server {
     # Listen HTTPS
     listen 443 ssl;

     # SSL config
     ssl_certificate /path/to/your/certificate/file;
     ssl_certificate_key /path/to/your/certificate/key;

     # Proxy Config
     location / {
         proxy_pass http://strapi;
         proxy_http_version 1.1;
         proxy_set_header X-Forwarded-Host $host;
         proxy_set_header X-Forwarded-Server $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Proto $scheme;
         proxy_set_header Host $http_host;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection "Upgrade";
         proxy_pass_request_headers on;

and this is the error I see in the browser console when I try to open the admin panel -