Hello everyone —
I am using official ghost docker image for my blog, which i wanted it to be served under http://my-url.com/blog with nginx as reverse proxy. The nginx proxy configuration as follows
server {
listen 80 default_server;
server_name my-url.com;
location / {
rewrite ^/(.*) /$1 break;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://web:80;
}
location /blog {
rewrite ^/blog(.*) /$1 break;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://blog:2368;
}
}
and i am using docker compose to runs my services . The docker-compose file looks like this
version: '3.2'
services:
web:
build: portal
container_name: app
networks:
- proxy
volumes:
- ./assets:/usr/share/nginx/html/assets/
ports:
- "9000:80"
blog:
image: ghost:2-alpine
container_name: blog
networks:
- proxy
volumes:
- /opt/blog:/var/lib/ghost/content
- ./config.production.json:/var/lib/ghost/config.production.json
ports:
- "9002:2368"
environment:
NODE_ENV: production
proxy:
build: proxy
container_name: proxy
networks:
- proxy
ports:
- "80:80"
networks:
proxy:
external: true
and my config.production.json
file looks like
{
"url": "http://my-url.com/blog",
"server": {
"port": 2368,
"host": "0.0.0.0"
},
"database": {
"client": "sqlite3",
"connection": {
"filename": "/var/lib/ghost/content/data/ghost.db"
}
},
"mail": {
"transport": "Direct"
},
"logging": {
"transports": [
"file",
"stdout"
]
},
"process": "systemd",
"paths": {
"contentPath": "/var/lib/ghost/content"
}
}
when i visit my page the i get the following error cannot GET /
. I barely have no clue why this is happening and was also unable to find any solutions for it. Some help or suggestion would be much appreciated.
Thank you.