Perfect guideline for dummies to: "How To Configure Nginx as a Front End Proxy for Apache"
-
@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.
-
-
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; }
}
-
Yes, NodeBB is running, but the setup is not kosher. It is accessible from forum.caffeh.com and also from caffeh.com.
What's the point of running a forum application from the root of the site and also from a subdomain of the same site. I doubt if that's what you want. If you wish to run it from a subdomain of caffeh.com, which assumes that there is a Web app running on caffeh.com, the the url should be forum.caffeh.com. If from a subfolder of caffeh.com, it should be caffeh.com/forum.
Both setups require a different VirtualHost configuration.
So, which one do you want?
-
@planner you bet it right! I want ONLY nodebb to run @forum.caffeh.com, planning to install YUI or Docpad in the caffeh.com and to let my server IP empty (or default nginx file)
I think my problem is that I have disabled all virtualhost support, that forum is my "default virtual host". How to fix that? -
We you've got to take another look at your configuration, because right now, your server IP is not empty or running the default Nginx file
-
@xpcontact Right now, since NodeBB is the only virtual host, any requests to your server will cause it to load the NodeBB.
Note this line:
server_name forum.caffeh.com;
This means that nginx will specifically listen for requests to
forum.caffeh.com
, but if a request comes in requestingcaffeh.com
, and it does not match, it will load the first virtual host it finds. For some further reading, click hereOnce you set up docpad and set up its own proxy listening to
caffeh.com
, nginx will no longer redirect requests to that url to NodeBB. -
@planner I usually do a daily search for nodebb on google (results from past 24 hours) and I routinely find your NodeBB @ linuxbsdos.com on the list. Your forum is on port 4567 so I was wondering if you had any issues routing it to something like forum.linuxbsdos.com etc.
-
It's not even supposed to show up on search engines yet, because I've not made it public and don't intend to until the end of the month. I'm waiting for key features to be implemented before it goes public, so I'm taking this time to populate it with quality content
But, yes, it's on the port default port because I'm still trying to figure out how to route it to linuxbsdos.com/forum. I don't want to go the subdomain route.
If you are wondering what features I'm holding out for, email notifications and anti-spam registration are tops.
-
okay FYI there's a robots.txt editor in the ACP if you really didn't want it to show up on google search