Apache Can';t在没有端口的子域上运行Ghost blog

Apache Can';t在没有端口的子域上运行Ghost blog,apache,nginx,ghost-blog,Apache,Nginx,Ghost Blog,我不熟悉nginx、Ghost和管理服务器,如果不指定to port:2368 可以,但不能 我的digital ocean droplet上有两个站点,在/etc/nginx/sites enabled/中有两个.conf文件。它们是ghost.conf和ingledow.co.uk 顺便说一下,目录/etc/nginx/conf.d/是空的 Ghost的config.js /etc/nginx/nginx.conf /etc/nginx/sites enabled/ghost.conf 配置

我不熟悉nginx、Ghost和管理服务器,如果不指定to port
:2368

可以,但不能

我的digital ocean droplet上有两个站点,在
/etc/nginx/sites enabled/
中有两个.conf文件。它们是
ghost.conf
ingledow.co.uk

顺便说一下,目录
/etc/nginx/conf.d/
是空的

Ghost的config.js /etc/nginx/nginx.conf /etc/nginx/sites enabled/ghost.conf
配置似乎还可以,但我认为
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'
    }

我有一个类似的问题,这是因为最初我更改了Ghost config.js文件以使用我的服务器的IP地址和域名,这样我就可以通过IP:2368和domainname访问它。一旦成功了,我想设置nginx监听端口80并重定向到端口2368。但是,一旦您设置了nginx,它将在服务器的IP上侦听端口80,因此您将希望重定向到Ghost,它应设置为localhost地址127.0.0.1,而不是服务器的IP,并且端口应为2368(如果尚未设置)。gl.

你说的不工作是什么意思?白页?404? 502?
http {
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}
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;
    }
}
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'
    }