Skip to content

Multiple levels + NGINX #38

@yamila-fraiman

Description

@yamila-fraiman

I'm trying to configure a multi level subdomain with nginx and express-subdomain.
In NGINX I have:
upstream backend-project { server unix://home/project/webserver/server.sock; } server { listen 80; server_name admin.project.example.com; location / { proxy_pass http://backend-project; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $remote_addr; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } }

And in Node:
app.use(subdomain('admin', require('./admin')(db)));

I've tried setting 'subdomain offset' but req.subdomains always returns [] except when I set it to 0 that returns backend-project.

Any idea? Locally using admin.localhost.dev (1 level) this module is working good

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions