Perfect guideline for dummies to: "How To Configure Nginx as a Front End Proxy for Apache"
-
It would be useful for newbies to have simple and clear step-by-step guideline how to setup Nginx as a front end proxy for Apache.
-
@xpcontact may I ask why do you need both ?
-
That s good question, basically I do have Cpanel running (can it run only on Nginx?) I setup this server just to install NodeBB.
-
@xpcontact i never actually setup cpanel my self, i have a feeling it's php based, if so, you don't really need Apache, this is a guide on how to setup php with nginx, basically to run a wordpress site, but it's all the same, https://www.digitalocean.com/community/articles/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-12-04
then after you have your cpanel running, you can proxy your nodebb instance to nginx.
what kind of server are you running, and where?
-
@bentael I am running CentOS 6
-
remember to uninstall Apache, and if you can, drop that server, and start fresh,
DigitalOcean have them all, lol
-
I would still need the apache, because of the cpanel
(at least I know that I need the cpanel
)
I will try to work around using that tuts from DigitalOcean. Thx bentael!
-
For what you need to do to manage a Cloud server, you don't really need cPanel. But that's just me.
-
@planner it is not a cloud... it is a dedicated server from OVH... (the cpanel mainly for my customer, they did not like virtualmin nor ispaconfig)
-
Any useful information how to run nodebb forum without the :4567 port ?
-
@xpcontact This depends on a couple things. Are you running Apache or nginx on port 80 on that host right now? If the answer is no, just change the port to 80 in the config.json and restart app.js.
If the answer if yes, you need to proxy/reverse proxy the connection through apache or nginx.
A couple things I ran into with these configurations.
Apache needs to be on 2.4.x branch to support websockets via proxy.Running nginx, you need to be on the 1.4 branch of code to support websockets.
There is a guide to this in the nodebbwiki for use with nginx, and I posted my config in this thread http://community.nodebb.org/topic/761/takes-a-few-seconds-for-it-to-show-users-and-that-i-m-logged-in for how to use it in an apache environment.
-
@kelso Thank you for the effort to answer me
I am running only nginx (I deactivated httpd via cpanel) / Centos 6, (by the way I can't find this config.json file ?)
-
@xpcontact The
config.json
file is generated by NodeBB when you runnode app --setup
.@kelso Thanks for sharing your apache config! Hope you like what you see and stick around this forum
-
@julian No prob,I'm still getting my feet wet but really enjoying the feel of the system. I've actually switched to nginx now (don't know why I didn't do this sooner!), had to update to 1.4x manually as debian 7 uses 1.2 still and that version doesnt support websockets.
-
Are you installing in a subdomain, subfolder or in the root of your site?
-
@planner in the root, but thinking about using something as a frontend and moving this to a community/forum folder. This is for a brand new gaming site im working on and wanted to start off unique not only by the game but with the community as well.
-
Well, I'm looking to launch my forum by the end of this month, and install it in a subfolder of an active site, so if we install yours before I do, be sure to share you config with me.
-
-
Yeeesss!
-
Finally there is a light!
I do not remember the steps exactly, but mainly if someone having the same problem (running CentOS 6) you need to:nano /etc/nginx/conf.d/virtual.conf
add the code what was already mentioned many time:
https://github.com/designcreateplay/NodeBB/wiki/Configuring-nginx-as-a-proxy-to-NodeBB
So my problem was that I was not able to figure out the right files to edit! (when you guide people, you might always remind the path or mention exact file need to be edited - what is obvious for you, might be obscure for others)
Now the forum works fine, but there is a new problem:
I want to run nodebb only at http://forum.caffeh.com (as sub-folder or sub-domain) but I can see it is same running at the root (caffeh.com ) and at the server IP 37.59.29.104
My virtual.conf file:server {
listen 80;server_name forum.caffeh.com; location / { 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; }
}