The current situation is as follows:
I have a domain at a specific provider (manitu.de)
I have a free tier VPS with Oracle
I want to set up a ghost blog on the oracle VPS that should be reachable via the domain I have at manitu.de
So this is what happened until now:
I’ve set the IPv4 Forward-DNS A record for mydomain.de to forward to the IP of the Oracle server (let’s assume 1.2.3.4). During the ghost installation, it asks me for the name of my blog. So if I go and provide 1.2.3.4 as IP, I can reach the blog by using 1.2.3.4/ghost as well as mydomain.de/ghost - which is nice.
My problem: if I enter mydomain.de (or mydomain.de/ghost fwiw) in the address bar, it redirects to 1.2.3.4 which I want to avoid. That’s what I haven’t been able to solve properly yet because either it doesn’t redirect anywhere at all or I get stuck in a loop of redirections.
This is what my configuration looks like which is created by ghost during the installation process which I have added the second server block to:
server {
listen 80;
listen [::]:80;
server_name mydomain.de;
root /var/www/mydomain/system/nginx-root; # Used for acme.sh SSL verification>
return 301 $scheme://mydomain.de$request_uri;
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; # 2368 being the port ghost is using
}
location ~ /.well-known {
allow all;
}
server {
listen 80;
server_name 1.2.3.4;
return 301 $scheme://mydomain.de$request_uri;
}
Thanks in advance!