没有你的 Nginx 配置文件很难回答,但我还是会尝试,你需要配置 nginx 来监听那些子域,如果你成功了,你还需要在每个博客上配置 ghost blog config.js拥有不同的 url 和端口和数据库。
server {
listen 80;
server_name blog1.example.com;
location / {
proxy_pass http://127.0.0.1:2368/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
}
server {
listen 80;
server_name blog2.example.com;
location / {
proxy_pass http://127.0.0.1:2369/;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
}
}
blog1.example.com config.js
production: {
url: 'http://blog1.example.com',
mail: {},
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost1.db')
},
debug: false
},
server: {
host: '127.0.0.1',
port: '2368'
}
}
blog2.example.com config.js
production: {
url: 'http://blog2.example.com',
mail: {},
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost2.db')
},
debug: false
},
server: {
host: '127.0.0.1',
port: '2369'
}
}