Step 1: Install NodeBB, Step 2: Set up reverse proxy?

General Discussion
  • @Kamal-Patel

    hmmm.... If I got to that point I would just add it to the standard nginx.conf at the bottom. The default file may work maybe...? I don't really know what that is for. If I got to that point I would just tack the proxy info to the bottom of the nginx.conf file. For me this is at /etc/nginx/nginx.conf.

    Mine looks like

    server {
          listen   myipaddress:80;
         server_name domain.com www.domain.com;
         error_log path/to/logs error;
    
         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;
    
            # Sockect.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    }
    

    Edit: I don't know why it put some of it in a nice box. I don't know markup well enough to know why, but that whole section is there

  • As @HolyPhoenix suggested, you can place it at the bottom of the nginx.conf file. However....

    Purely for organization purposes, I prefer using the sites-available folder. Your nginx.conf file is probably set up to look there already.

    Create a new file called whatever you want:

    • cd /etc/nginx/sites-available
    • touch hotpotato

    Then edit this file:

    • nano hotpotato

    Paste the config in there, altering as necessary, and then activate the file:

    • cd ../sites-enabled
    • ln -s ../sites-available
  • I tried what Julian said and got this message:

    ln: failed to create symbolic link `./sites-available': File exists

    And this error when running nginx -t:

    nginx: [crit] pread() "/etc/nginx/sites-enabled/sites-available" failed (21: Is a directory)
    nginx: configuration file /etc/nginx/nginx.conf test failed

    I tried all three of the methods listed in the documentation, but no dice. Any tips? I just did the regular digital ocean setup for dummies, but I can't get past the reverse proxy step even after reading every single mention of "nginx" on the forum. I feel like a grade-A moron 😞

    By the way, the site is at http://nutritionask.com:4567.

    When I use the nginx.conf file I paste the server block at the end and get this error:

    2014/05/16 15:33:47 [emerg] 30304#0: "server" directive is not allowed here in /etc/nginx/n ginx.conf:97
    nginx: configuration file /etc/nginx/nginx.conf test failed

    Here is what I pasted. How do you make it all cool looking with the black background btw?

    server {
    listen 0.0.0.0:80;

    server_name nutritionask.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;
    
    # Socket.IO Support
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    

    }
    }

  • Seems like you linked the sites-available directory inside sites-enabled. Give this a shot:

    rm -rf /etc/nginx/sites-enabled/sites-available
    
    ln -s /etc/nginx/sites-available/hotpotato /etc/nginx/sites-enabled/hotpotato
    

    and then run nginx -t, if all checks out reboot nginx and hopefully you're good 🙂

  • @psychobunny

    You're a good luck charm! I moved the lines up into the http directive in the nginx.conf file, and it worked. I've been at this for a few days...is there any way that (if I learn a bit more about commands and such), I can help add a few more lines to the reverse proxy documentation page so that dummies like me won't screw up?

    Also, do you know if I have to delete the lines from the other locations I tried (sites-available, default) and remove the link? Just wanna make sure that having the same stuff in three different locations isn't gonna screw something up later.

  • @psychobunny @julian

    Thanks for this thread, and I think this kind of information can be placed in docs or wiki.

    I use nginx now, and the default page of mydomain.net works, and mydomain.net:4567 works for nodeBB.

    Now, I try to implement sub.mydomain.net proxy to 127.0.0.0:4567 (nodeBB), so I tried:

    /etc/nginx/sites-available/subdomain

    server {
          listen   myipaddress:80;
         server_name sub.mydomain.net;
         error_log ./log error;
    
         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;
    
            # Sockect.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    }
    
    

    But seems not working.

    I properly set the symbolic link in /etc/nginx/sites-enabled/

    ln -s /etc/nginx/sites-available/subdomain
    

    So here is no problem, I think.

    Please advice ,
    Thanks.

    PS. reading

    https://media.readthedocs.org/pdf/nodebb/latest/nodebb.pdf
    I've changed

    server {
          listen   myipaddress:80;
    //........
    

    and
    sudo /etc/init.d/nginx restart

    The result is same...
    sub.mydomain.net does not lead to mydomain.net:4567...

    Ubuntu 14.04
    nginx version: nginx/1.6.0

  • @Ken-OKABE What do you see when you go to sub.mydomain.net? An nginx error?

    Make sure the subdomain is routed properly via your DNS server (so that sub.mydomain.net goes to the same ip as mydomain.net), and make sure that nginx is reading configuration files from sites-enabled/, you can check that by looking near the bottom of nginx.conf.

  • @julian No, the browser says - Oops! Google Chrome could not find sub.mydomain.net

    Currently, I'm trying to figure out how to observe nginex behavior with log.

    So far, simply,
    mydomain.net shows the frontpage of nginex.
    mydomain.net/4567 shows the nodeBB properly.

    Thanks

  • @julian said:

    Make sure the subdomain is routed properly via your DNS server (so that sub.mydomain.net goes to the same ip as mydomain.net),

    Oh my... I totally miss it!

    You have true insights always. Appreciated Julian.

  • @julian Just works as intended.
    The approach here totally works.
    As you kindly suggested, it's my mistake not to have set subdomain by DNS.
    I somehow misunderstood Ngynx takes care of subdomainsDNS IP routing, my bad.
    Thanks a lot.

  • This post is deleted!
  • This post is deleted!

Suggested Topics


  • 1 Votes
    2 Posts
    882 Views

    Hey @mglace -- nice to hear you're looking to migrate!

    The best way to migrate would be to build your own exporter by forking an existing one... for example the SMF exporter... they work with the importer plugin: https://github.com/akhoury/nodebb-plugin-import

    Alternative you could use the Write API, although you'd be writing a lot of the one-time logic yourself to migrate users and posts and such, and I don't know offhand of anybody using the Write API quite like that 😄

    You're on track with the SSO OAuth plugin. DFP should work using the adsense plugin... if not, you can ping @baris for help.

    Theming NodeBB is one of our strong points, our themes are very customisable. Almost everything can be customised including templates for each page, as well as adding additional styles, etc. Check out the quickstart theme for a shell to start off with 👍

  • 0 Votes
    4 Posts
    2k Views

    Humm, you can't do that

  • 0 Votes
    1 Posts
    1k Views

    Had a few slight problems getting this working. It crashed my forum and my blog, which reside on separate servers. I'm running NodeBB 0.7.0-dev with a new Wordpress install.

    I installed the plugin and followed the guide on how to set it up. So all was working. I posted a blog article to test the comments engine (using forum plugin), and when I clicked the button under the article to send the article to the forum, it produced an error, which said I either had to be a member of publishers group or admin to post. I was logged into NodeBB as admin, and Wordpress too.

    My forum started grinding to a halt, throwing up 502 errors in the process.
    My blog collapsed and is currently sitting with a "Error establishing a database connection" notice. It's still like this, and i'll repair that when I get the chance.

    The strangest aspect however is that the blog DID post to the forum. 32,800 times, no less! You can see the topic here - I set up a category for the blog articles to be posted to.

    http://www.onlyanexcuse.com/category/12/onlyanexcuse-blog

    I realise to get a further insight i'll have to look into the error logs which I intend to do, but can anyone help? I've since removed the blog's server from DNS so it's no longer visitable through links and the forum is back to being the homepage.

  • 0 Votes
    4 Posts
    2k Views

    @avi Hard to say, they could be doing it through cookies, if you upvote a deal, the upvote of that deal is saved into your cookies, then if you try again in the same browser, it knows you've done it already, however this is also circumventable by changing browsers and deleting your browser cookies. You can make it hard for someone to fake votes, but you can't stop it.

    I think a mixture of email confirmation, cookie usage, limiting who can upvote and downvote (need to post a deal in order to vote for other deals, or something like that) and keeping an eye on activity would deter enough people not to bother trying to fake the votes.

    You'd have to post the deal, log out, clear your entire browser cache, cookies, history etc, create an email account, sign up, verify your account, upvote, then do the whole thing again, the time taken isn't worth it, it would be easier to hire a team of people in the east to do it for you (similar to likes on facebook or views on youtube), and you can't stop them unless you place blanket IP bans on subnet ranges. Which, if you're only concentrating on one place, then that would be fine.

  • NodeBB vs webfaction

    General Discussion
    4
    0 Votes
    4 Posts
    2k Views

    @george-paraschiv

    Do you need hosting for a production NodeBB or one for just testing and stuff like that? I could probably provide you with both, I've got unused resources that I could allocate for you. But I think for this I can only allocate 1 CPU and 4 threads, 2048MB mem and 100GB HDD space. But if you contact me with more details it will be easier to tailor the box.

    Fire off a message with details and I'll help you out, I can be reached at i.am/@/k0nsl.org

    Regards,
    -k0nsl