我是 nginx、Ghost 和管理服务器的新手,如果不指定端口,我无法弄清楚如何让 ghost 运行:2368
http://blog.ingledow.co.uk:2368有效,但http://blog.ingledow.co.uk无效。
我的数字海洋水滴上有两个站点,其中包含两个 .conf 文件/etc/nginx/sites-enabled/
。这些是ghost.conf
和ingledow.co.uk
顺便说一下,目录/etc/nginx/conf.d/
是空的。
Ghost 的 config.js
// ### Production
// When running Ghost in the wild, use the production environment
// Configure your URL and mail settings here
production: {
url: 'http://blog.ingledow.co.uk',
mail: {},
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost.db')
},
debug: false
},
server: {
// Host to be passed to node's `net.Server#listen()`
host: '146.185.179.133',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
}
}
/etc/nginx/nginx.conf
http {
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
/etc/nginx/sites-enabled/ghost.conf
server {
listen 80;
server_name blog.ingledow.co.uk;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
proxy_buffering off;
}
}