0
我有一个HapiJS Node web应用程序example.com当前正在运行。我想添加一个论坛,在我的网站上建立一个社区,网址为example.com/community将论坛添加到我的Nodejs Web应用程序
直到现在我已经看过NodeBB。但是,它运行在它自己的独立节点服务器上,我无法弄清楚如何将其指向我的原始域(example.com)
我有一个HapiJS Node web应用程序example.com当前正在运行。我想添加一个论坛,在我的网站上建立一个社区,网址为example.com/community将论坛添加到我的Nodejs Web应用程序
直到现在我已经看过NodeBB。但是,它运行在它自己的独立节点服务器上,我无法弄清楚如何将其指向我的原始域(example.com)
你会想要使用像nginx这样的反向代理,所以请求/
被发送到HapiJS应用,并且请求/community
被发送到NodeBB。在nginx的配置
相关章节
location/{
.. do whatever
}
location /forum/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
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";
}
仅供参考,我删除了不相关的_php_标签。您应该只添加_relevant_标签。 –