Hi,
I am currently holding my ghost website on my Synology Nas. There is one issue I cannot resolve: I cannot access ghost by local IP + port number. I can access other applications I put on Nas using this method, but not for ghost. In addition, the website can be accessed by domain
The error message is: ERR_SSL_PROTOCOL_ERROR
And I noticed that although I try to use HTTP:// IP: port to access,it will automatically switch to use HTTPS, which results in the error message I believe. I am confused on it…
Appreciate for any solutions and helps!
Can you post your config..json file, minus any secrets?
Hi, here is the .yaml file I used to create the container…
I am not sure where to find the config file since I’m using docker…
version: ‘3.1’
services:
ghost:
image: ghost:5-alpine
restart: always
depends_on:
- db
ports:
- 8061:2368
environment:
database__client: mysql
database__connection__host: db
database__connection__user: root
database__connection__password: ***
database__connection__database: ghost
mail__transport: SMTP
mail__options__host: smtp.mailgun.org
mail__options__port: 587
mail__options__service: Mailgun
mail__options__secure: false
mail__options__requireTLS: true
mail__options__secureConnection: false
mail__options__auth__user: ***
mail__options__auth__pass: ***
url: https://$ {my_domain}
volumes:
- /volume1/docker/ghost/volumes/ghost-data:/var/lib/ghost/content
db:
image: mysql:8.0
restart: always
environment:
MYSQL_ROOT_PASSWORD: ***
volumes:
- /volume1/docker/ghost/volumes/mysql-data:/var/lib/mysql
Raki
September 24, 2024, 9:41pm
4
How did you configure the Nginx
Hi, I am atually using Cloudflare for reverse proxy…
Your url says https, which is causing http to redirect.
Raki
September 24, 2024, 10:28pm
7
You need to configure your reserve proxy to pass X-Forwarded-Proto: https
header, so Ghost won’t forward HTTP to HTTPS.
You can try run the following command on your server to test if the header works:
curl -H "X-Forwarded-Proto: https" http://localhost:8061
I found that there is a place for adding title and value in Synology’s reverse proxy setting.
However, the problem is not resolved…
But the curl does work.
Raki
September 25, 2024, 12:35am
9
Not sure how to do this with Synology.
I forgot to mention, don’t write https
directly in reverse proxy. Instead, pass the user’s protocol (http
or https
) to the X-Forwarded-Proto
header to protect your Ghost site from HTTP requests
It works now!
I changed url in .yaml from https to http, and added headers in the proxy setting, and it works!
Thanks so much for help!
1 Like
Raki
September 25, 2024, 1:33am
11
I changed url in .yaml from https to HTTP
This may introduce errors on the client side. You can observe these errors in the browser developer tool’s console tab when running your Ghost site.
Yeah ur right, the mixed http and https error…
I just tried only changing the https setting back to http, the problem came back :(
Raki
September 25, 2024, 4:48am
13
Ghost requires HTTPS in the production env.