Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8658811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:51:26+00:00 2026-06-12T15:51:26+00:00

Background : I am using nginx as a reverse proxy to my express server

  • 0

Background: I am using nginx as a reverse proxy to my express server to handle SSL. I use the everyauth package to handle facebook oauth. Redis is used for session store.

Problem: On the first auth request everyauth will timeout on the getAccessToken auth step. On the second auth request it will complete all auth steps and return.

Specifically: I have followed the execution to a point where everyauth uses the request package during the getAccessToken step. Request uses the https module to make a request which never returns (callback is never executed).

Code

var express = require('express')
  , RedisStore = require('connect-redis')(express)
  , everyauth = require('everyauth')
  , Promise = everyauth.Promise
  , app = express.createServer()
  , authConfig = require('./auth_config');

// Configure server to allow reverse proxy (nginx) to handle SSL requests
app.enable('trust proxy');
app.set('env', process.env.npm_package_config_env);

//everyauth config
everyauth.facebook
    .appId(authConfig.facebook.appId)
    .appSecret(authConfig.facebook.appSecret)
    .redirectPath(authConfig.facebook.redirectPath)
    .scope(authConfig.facebook.scope)
    .popup(true)
    .findOrCreateUser(function(session, accessToken, accessTokExtra, fbUserMetadata){
        ...
    });

app.configure(function(){
    // Check if behind secure reverse-proxy
    app.use(require('./middleware/secureProxyCheck')());
    app.set('views', __dirname + '/views');
    app.set('view engine', 'jade');
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(express.cookieParser());
    app.use(express.session({
        secret: 'imnottelling', 
        store: new RedisStore({ host: "127.0.0.1", port: "6379" }),
        cookie: { secure: true }
    }));
    //WARNING: do not change the order of everyauth and router
    app.use(everyauth.middleware());
    app.use(app.router);
    app.use(require("./middleware/dynamicCacheHeaders")("sha256"));
});

/*app.get app.listen beyond this point*/

Versions

  • Node: 0.8.8
  • Express: 2.5.10
  • connect-redis: 1.4.4
  • Everyauth: 0.3.0
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:51:28+00:00Added an answer on June 12, 2026 at 3:51 pm

    This problem was actually not related to anything mentioned above. The problem is caused because I did not read the documentation on daemon.node carefully enough. Nothing works on the first time around because they are all tied to the previous process which node is no longer running in. Hard to debug but very easy to fix (READ THE DOCUMENTATION).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: Using jQuery 1.7 client side PHP server side Using json responses with json_encode
Background : Am using Django. Am hosting my site on Dreamhost. Am using Nginx
I am using nginx and redis in my website. For several items on my
Background: Using Facebook PHP SDK v 2.1.2 cookieSupport = true App on Facebook has
I'm loading a bitmap in the background using the AsyncTask class. I use the
I'm trying to use a Google Maps Street View as a background using a
Background: Using unix, codeigniter from localhost. I'd like to run a controllers via a
Background Using boost and other similar libraries is the easiest way to find compiler
Background Using JavaScript, I need to sort a large JSON object based on a
How to make android icons with transparent background using eclipse.I know that we can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.