Hi all, hope someone can help as I’m struggling to get this working over HTTPS!
I have searched through this forum and tried all the different combinations over ports / HTTP / HTTPS I can think of but no success. This post is very similar to my situation…
Ghost-CLI version: 1.21.0
Ghost version: 5.2.2
Ghost server OS: Ubuntu server 20.04.4
Node: v16.15.1
Database: MySQL
DNS: Cloudflare
Cloudflare SSL: Tried full and full (strict)
Ghost server local IP: 10.0.40.5
Nginx Proxy Manager server IP which I’m using for my reverse proxy: 10.0.40.90
Followed this guide for install: https ://ghost. org/docs/install/ubuntu/
Hope I can get this figured out as I like what I have seen in Ghost so far! I have had Wordpress working on this same server (clean rebuild before I installed Ghost) so I know the DNS records etc point to the right place and the Cloudflare cert can work with the NPM reverse proxy etc.
Details below but let me know if I’ve missed anything!
Thanks!
I have successfully got this working by setting my config.production.json to http://ghost.mydomain.co.uk however I then get errors in the browser console complaining about some images trying to load over HTTP and it also says Stripe won’t work as I don’t have HTTPS enabled (I’m not planning to use Stripe anyway), however it also stops the membership sign up button from working.
As soon as I change my ghost config to https://ghost.mydomain.co.uk and then restart it I then can’t get to Ghost.
I am using Cloudflare as my DNS host and have the records proxied.
In Nginx Proxy Manager (NPM) I have tried various combinations of the following:
Proxy host scheme set to http or https.
Forward hostname / IP: 10.0.40.5
Forward port: 80 or 443 or 2368. If I set it to 2368 I cannot access Ghost at all (on http or https). From what I understand I should be able to use my reverse proxy to get to this port as that’s all the reverse proxy installed with Ghost does?
NPM: Custom locations - nothing configured in here.
NPM SSL - I have tried a LetsEncrypt cert (created by NPM) and also a Cloudflare Origin cert. Force SSL and HTTP/2 support enabled.
NPM advanced: below config.
location / {
proxy_pass http:// 10.0.40.5:2368; (# I matched this to the host forward port each time so 80 / 443. Space in this line just for this post)
proxy_set_header Host $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 $https;
proxy_set_header Host $http_host;
proxy_intercept_errors on;
}
In the ghost.mydomain.conf I have the following but I also tried changing the listening port to 443. I’m not sure if I need to touch this file if I’m using my own reverse proxy on a different server?
server {
listen 80;
listen [::]:80;
server_name ghost.mydomain. co. uk; (Space in here just for this post)
root /var/www/mydomain/system/nginx-root; # Used for acme.sh SSL verification
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; (space in here just for this post)
}
location ~ /.well-known {
allow all;
}
client_max_body_size 50m;
}