login troubles - with port fine - without - no go

Technical Support
  • So i have setup nodebb on a vps running wordpress, nginx, varnish, and nodebb is using mongo - i know nothing about mongo - i just know it's less resource intensive and it's object oriented. i can login when i use the port (4567) - i can access teh domain withou a port - however any attempt to login on the domain without the port fails. same login works with the port.

    registration is also forbidden on the naked domain. however works fine with the port. it took me all day to get this setup with varnish and nginx with existing wp install without using redis and i'm stumped. i love this software - i almost gave up on it for discourse bc it just works but i don't like how much of a hog it is. any help would be appreciated. thanks! fyi you can see my config on pastebin here:
    link text

  • Have you tried to set up nginx (or Apache), see this:

  • Did you see my config? I'm solid with nginx - so i'm banging my head here. varnish is new to me but that performance boost is incredible. I'll take a look at the docs again - but i've been going through the pdf version with a fine tooth comb and not sure where i'm going wrong here.


    That's my config above - both varnish - config.json - and nginx included. I actually don't use apache -

    Default port is set to 8080 which is how i have the server block setup for forum.mysimpleclouds.com - you can see everything at the pastebin link above. I posted my entired configuration there.

    I thought about adding an additional block to the fqdn however since it's wordpress it's just going to complicate things being as it's php and not nodejs/javascript. It was easier to setup another vhost.

    I'm new to nodejs - and love nodebb - since i first set my eyes on it i wanted it. you guys did a great job. I tested it out with docker then decided to bring it live because I loved it so much. I see so much potential in this - way more than forum software. Plus it's so fast with varnish/nginx that i'm literally going to be replacing my wordpress sites one by one - once i figure out how to get it to survive reboots. Looking at upstart scripts / forever - but can't seem to nail that down yet.

    I am ultra proficient with NGINX - so a proxy setup is nothing new to me - and I have some pretty advanced nginx configs setup for clients/our own sites but it's a whole new ball game with node. I'm stumped. I spent almost 24 hours getting it up and going with mongo /nginx/varnish - and then finallly got it off the port and was like wtf. Take a look at my setup and let me know if you see anything wrong there. I followed your docs and added a couple things for performance boosts but other than that, this is a pretty simple setup at this point.

    FYI I don't use Apache - it's bloat to me and not needed imo. I only use it when I absolutely have to. NGINX powers everything we use.

  • Woops okay haha (generic response FTL). Did you remove the 4567 from config.json?

    Edit: nvm, clearly I can't read after 2am. I'll have another look in the morning 🙂 I have no experience with varnish though.

  • haha same here bro. i'm still at it lol. i don't have much experience with varnish either - honestly i had a preconfigured bash script take care of that side for me - originally just to see how much of an improvement there was.

    initially i couldn't get redis configured properly - old version - then I added chris/leo/redis-server repo and ran apt-get update && apt-get upgrade and bang got redis running now. I don't know mongo at all - never used it - only was using it to get this running lol. i literally just made sure that ports matched up on everything for the proxy pass to varnish (in the server block).

    But I ran a few benchmarks and I swear varnish has kicked up performance to a whole new level. I've been reading and it's actually not too tough - raul bansel will say do it all with nginx - i'm starting to disagree lol. it's a bit more of a configuration setup but my motto isn't to reinvent the wheel - it's to use it, tweak it, add to it, and do what you want after that :-).

    I'm not finished configuring yet - but i was able to get it running with nginx/redis off port much easier (with another instance) but no varnish. we will see what happens.

    I actually never had the port in there to begin with. I did put "use_port" = false, in there and the url is there too.

  • got it 🙂

  • If you want, feel free to share the config above - works with redis - not mongo - which is fine with me bc I prefer redis all day anyhow. it's 30 times quicker and smarter in my limited experience with mongo - you know it picked up the data i already had in mongo and I didn't even do anything :-). This could have been the forever logs - but I have no idea - node is new to me - but i'm starting to really like it.

    Would you happen to have your upstart script that you use to keep your forums going on reboot? Or method that you use? Like specific - that will be the icing on the cake for me.

Suggested Topics

  • Login problem 2.0.1

    Solved Technical Support
    2 Votes
    24 Posts

    @murcs You can simply take the file from there and overwrite in your own install.

    For example, if you locate the plugin itself in your folder structure, then open library.js and change

    const utils = require.main.require('./public/src/utils');


    const utils = require.main.require('./src/utils');

    And rebuild, this should then work.

  • 0 Votes
    1 Posts

    Hi all,

    still continuing on my OAuth2 plugin implementation, I've a problem I can't actually solve and need you valuable advises.

    I've this fragment in my plugin

    OAuth.getStrategy = function (strategies, callback) { winston.verbose('[maxonID] --> OAuth.getStrategy'); if (configOk) { passportOAuth = require('passport-oauth2'); passportOAuth.Strategy.prototype.userProfile = function (accessToken, done) { if (!accessToken) { done(new Error('Missing token, cannot call the userinfo endpoint without it.')); } this._oauth2.useAuthorizationHeaderforGET(true); this._oauth2.get(constants.userRoute, accessToken, function (err, body, res) { if (err) { console.error(err); return done(new Error('Failed to get user info. Exception was previously logged.')); } if (res.statusCode < 200 || res.statusCode > 299) { return done(new Error('Unexpected response from userInfo. [' + res.statusCode + '] [' + body + ']')); } OAuth.validateEntitlement(accessToken, constants.allowedEntitlement, function (err, accessAllowed) { if (err) { return done(err); } if (!accessAllowed) { // Need to find a way to gracefully notify the user and point back to login page return done(new Error('Forum access is not granted. Please contact your representative.')); } try { var json = JSON.parse(body); OAuth.parseUserReturn(json, function (err, profile) { ...

    and I'd like to return the user to the forum login page and notify him about the issue, something like when the password is wrong. Is there a smart way to make it happen from such a plugin without rising an error?

    Thanks a lot for your valuable insights, R.

  • 0 Votes
    2 Posts

    nodebb-plugin-customize will allow you to modify translations, including this one

  • 0 Votes
    4 Posts

    Yeah I'm running the latest stable. 0.7.3 a back-port would be great 🙂

    'Which blows up your forum if they entered the registration queue'

    Well said! 😄

  • 0 Votes
    2 Posts

    Ok, when I switched to using a clustered setup with nginx serving static assets this issue went away.