我想在xxx.xxx.xxx.xxx/nodebb
上設置NodeBB。我對Nginx的和NodeBB以下設置:NodeBB with Nginx - 「這個網頁有一個重定向循環」
/etc/nginx/conf.d/nodebb.conf
server {
listen 80;
server_name localhost;
location /nodebb/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://127.0.0.1:4567/;
proxy_redirect off;
# Socket.IO Support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
/usr/share/nginx/nodebb/config.json
{
"base_url": "http://`xxx.xxx.xxx.xxx",
"port": "4567",
"secret": "xxxxxx-xxxxxxxxxxx-xxxxxx-xxxxx",
"bind_address": "0.0.0.0",
"database": "mongo",
"mongo": {
"host": "127.0.0.1",
"port": "27017",
"username": "xxxxxxxx",
"password": "xxxxxxxxxxx",
"database": "xxxxxxx"
},
"bcrypt_rounds": 12,
"upload_path": "/public/uploads",
"use_port": false,
"relative_path": "/nodebb"
}
當我導航到xxx.xxx.xxx.xxx/nodebb
時,我被重定向到xxx.xxx.xxx.xxx/nodebb/404
,並顯示瀏覽器錯誤消息This web page has a redirect loop
。任何想法我做錯了什麼?
編輯:只是說如果我瀏覽到http://xxx.xxx.xxx.xxx:4567/nodebb/
- 它工作正常