Can’t load Ghost on IP address

If you’re looking for some help, it’s important to provide as much context as possible so that people are able to assist you. Try to always mention:

It seems like having a domain is a dependency. My use case is that the authors keep thinking the ghost on any of my subdomain is ”wrongly install” and after explanation we can export the posts etc, though they get it but it seems psychologically it’s blocking.

I was thinking to just have it on an IP instead but can’t figure out how.

@ajmalafif it looks like Ghost is correctly configured. Have you updated your nginx configuration to proxy correctly on the IP address?

Hey thanks for jumping in! I tried (by looking at 2018ish tutorials) but none of it worked. Now it‘s vanilla.

What do you mean by vanilla? Are you able to share your nginx configuration?

I‘m trying to copy paste it but it doesn‘t work with nano and I dont know how to use vim. One sec lemme figure it out and paste it here.

Hi Kevin, thanks for waiting I managed to quit vim :stuck_out_tongue:

##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
        listen 80 default_server;
        listen [::]:80 default_server;

-- VISUAL LINE --                                                                                                                                                                                               91        1,1           Top
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal7.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##

# Default server configuration
#
server {
        listen 79 default_server;
        listen [::]:79 default_server;

-- VISUAL LINE --                                                                                                                                                                                               91        1,1           Top
        #location ~ /\.ht {
        #       deny all;
        #}
}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#       listen 79;
#       listen [::]:79;
#
#       server_name example.com;
#
#       root /var/www/example.com;
#       index index.html;
#
#       location / {
#               try_files $uri $uri/ =403;
#       }
#}

If that’s your nginx config, it is missing a lot. Primarily, it’s missing the section where you route requests to your local server internally. I would re-try using Ghost CLI to generate your nginx config for you.

You might also save yourself some trouble next time by using cat to output directly to the screen all in one shot. You should be able to cut and paste the whole thing a lot easier that way. :slight_smile:

Hi, I am facing same issue. IP address is 150.136.235.77 and My nginx config is

server {
    listen 80;
    listen [::]:80;

    server_name 150.136.235.77;
    root /var/www/ghost/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh)

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:2368;
        
    }

    location ~ /.well-known {
        allow all;
    }

    client_max_body_size 50m;
}

Also, this is from the config.production.json

{
  "url": "http://150.136.235.77",
  "server": {
    "port": 2368,
    "host": "127.0.0.1"
  },

Is there a solution for this? I am having the same issue, running mutiple instances on the same server, i can only load the first site, wont be able to load the rest sites. I got message connecction refused on port 2368, 2369 2370…

Does your server have multiple IP addresses?

If it only has one IP then you need to setup your DNS and nginx server_name directives.

That’s likely your problem, the server will only listen on the 127.0.0.1 loopback interface. Try 0.0.0.0 to listen on all IPs or your specific 150.136.235.77 IP depending on your use-case.

Yes, has to change “localhost” to the host IP