我是nginx、Ghost和管理服务器的新手,不知道如何在不指定端口:2368的情况下让ghost运行
http://blog.ingledow.co.uk:2368可以工作,但http://blog.ingledow.co.uk不能。
我在我的数字海洋水滴上有两个站点,其中有两个/etc/nginx/sites-enabled/格式的.conf文件。它们是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;
}
}发布于 2014-01-27 22:30:03
配置似乎还可以,但我认为config.js文件中的主机地址应该是127.0.0.1。
server: {
// Host to be passed to node's `net.Server#listen()`
host: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
}发布于 2014-05-26 03:10:29
我遇到了类似的问题,因为最初我更改了Ghost config.js文件,以使用我的服务器的IP地址和域名,这样我就可以通过IP:2368和域名到达它。一旦成功,我希望将nginx设置为侦听端口80并重定向到端口2368。然而,一旦您设置了nginx,它将侦听服务器IP处的端口80,因此您将需要重定向到Ghost,它应该设置为本地主机地址127.0.0.1,而不是您服务器的IP,并且端口应该是2368 (如果还没有的话)。总帐
https://stackoverflow.com/questions/21369938
复制相似问题