Aidan
April 14, 2023, 12:50pm
23
From /etc/nginx/sites-available/Aidan-a.me.conf
listen 80;
listen [::]:80;
server_name aidan-a.me;
root /var/www/home/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;
}
From /etc/nginx/sites-available/Aidan-a.me-ssl.conf
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name aidan-a.me;
root /var/www/home/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh)
ssl_certificate /etc/letsencrypt/aidan-a.me/fullchain.cer;
ssl_certificate_key /etc/letsencrypt/aidan-a.me/aidan-a.me.key;
include /etc/nginx/snippets/ssl-params.conf;
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 1g;
}
Let me know if this is not what your looking for and I can try and find the files and things you need/want.
mjw
April 14, 2023, 1:05pm
24
Edit /etc/nginx/sites-available/Aidan-a.me.conf
to:
server {
listen 80;
listen [::]:80;
server_name aidan-a.me;
return 301 https://aiden-a.me$request_uri;
}
Then execute nginx -t
to check for errors, and if okay, run sudo nginx reload
.
Aidan
April 14, 2023, 1:08pm
25
So you want the file to look like this?
server {
listen 80;
listen [::]:80;
server_name aidan-a.me;
return 301 https://aiden-a.me$request_uri;
root /var/www/home/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;
}
If so I will apply these changes and run the commands above and try to access my site
mjw
April 14, 2023, 1:25pm
26
No, just what I pasted. Only SSL connections proxy pass to Ghost.
Aidan
April 14, 2023, 2:14pm
27
updated the file. I get this when I run the nginx -t command.
root@website:~# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
root@website:~#
Is this what you’re looking for? If so I’ll run sudo nginx reload in my ssh.
mjw
April 14, 2023, 2:37pm
28
Yes, it’s fine to reload Nginx.
Aidan
April 14, 2023, 3:04pm
29
After doing as told, and trying to load the page I either go to the nginx page or the a blank page.
I have the orange proxy cloud enabled on Cloudflare If this changes anything.
mjw
April 14, 2023, 3:19pm
30
Place Cloudflare in development mode, as this bypasses their cache. However, I note that your web server is handling www.aidan-a.me on the default server. I’d remove this from the config: rm /etc/nginx/sites-enabled/default
, then check (nginx -t
) and reload (sudo nginx reload
.)
mjw
April 14, 2023, 3:25pm
31
I see the issue: I spelled your site as aide n-a.me not aida n-a.me. So, amend the config file, and reload Nginx.
Incidently, always check any code before pasting as there may be errors, whether human or caused by rendering.
Aidan
April 14, 2023, 3:40pm
32
I fixed the code error and ran the commands above. Now when I visit my site(https://aidan-a.me ) I get an
when I try and visit via https://www.aidan-a.me It redirects me to aidan-a.me with this error.
mjw
April 14, 2023, 3:48pm
33
This looks like a DNS issue (the other is likely browser caching.
Does Cloudflare handle your DNS? It would seem that there is no A-record for your domain (only WWW.)
Aidan
April 14, 2023, 4:02pm
34
I use Cloudflare for my domain names. I have 2 dns records one to www and one to @
When I remove the default, a new default gets created.
mjw
April 14, 2023, 6:26pm
35
Your host is unreachable.
Please confirm that you have an A record like this:
A aiden-a.me <IP address of the VPS*> Proxied Auto
*This is the origin IP address, and what you use to access SSH.
Aidan
April 14, 2023, 7:06pm
36
I have pointed the ip of the vps to my dns records via a record.
mjw
April 16, 2023, 8:04am
37
Can you switch over to Development mode, so all I can see is Cloudflare proxy IPs.
Nonetheless, error 1016 is a Cloudflare error, and this means Cloudflare can’t see the origin server. Therefore, double check your DNS.
Aidan
April 16, 2023, 1:24pm
38
ok I have had development mode enabled and the ip addresses are correct. I can try to remove Cloudflare proxy cloud on my @ dns record and www dns record.
mjw
April 16, 2023, 4:43pm
39
Development mode does the same, only temporarily.
I’m now getting many redirects. Please confirm what files are in /etc/nginx/sites-enabled
, and that you did reload Nginx after changes the setup each time.
Aidan
April 16, 2023, 5:45pm
40
mjw:
/etc/nginx/sites-enabled
This is what is located in this folder location. I did reload nginx after each change made.
Aidan
April 25, 2023, 8:12pm
41
After having issues, I have moved to cloudron to install ghost and my site works now.
Hi all. He wants to install Ghost on a digitalocean, but it turned out to be not as easy as it is written in the instructions.
The droplet installed, went to the console as the root user, and then nothing happens. It’s just that the console is waiting for a command from me, and the instructions say that the droplet will continue the installation itself.
What need to do?