node.js - How to pass session on proxy with ExpressJS? -
my app running on 3000 , have set proxy points 3000 subdomain name session not working on proxy.
i have tried this:
app.enable('trust proxy');
but doesnt work.
nginx config
listen 80; server_name sub.domain.com; location / { proxy_pass http://domain.com:3000/; proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection 'upgrade'; proxy_set_header host $host; proxy_cache_bypass $http_upgrade; }
session config
app.use(session({ store: sessionstore, //tell express store session info in redis store secret: 'mysecret', key: 'emre', saveuninitialized: false, proxy: true, resave: true, maxage: 60000
use simple cookie-based session middleware.
Comments
Post a Comment