我正在尝试建立一个幽灵博客并想使用 nginx 来处理传入的请求。幽灵博客应该可以通过子 uri 中的 url 访问,例如:http://mydomain.com/blog文章将具有类似http://mydomain.com/blog/article1的 url
到目前为止,我尝试配置这样的设置没有奏效,而且我总是收到 404 错误。这是我的 config.js:
var path = require('path'),
config;
config = {
// ### Production
// When running Ghost in the wild, use the production environment
// Configure your URL and mail settings here
production: {
url: 'http://mydomain.com/blog',
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: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
}
}
}
// Export config
module.exports = config;
这是我的 nginx 配置:
server {
listen 0.0.0.0:80;
server_name mydomain.com;
access_log /var/log/nginx/mydomain-com.log;
location /blog {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header HOST $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:2368;
proxy_redirect off;
}
}
谁能告诉我我做错了什么?