Closed dyaa closed 8 years ago
something like
app.enable('trust proxy');
app.use(subdomain('api', router));
X-Forwarded-Host gives the content of the Host header the client sent to the proxy.
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header Host $http_host;
Nothing changed do u have any imagination about how nginx configuration have to be !
@dyaa I'm not much help to you I'm afraid. This isn't an issue with express-subdomain, and I've little knowledge of nginx.
First thing I'd try would be to replace proxy_pass http://127.0.0.1:3000;
with the domains in your hosts file. For example, if your hosts file looks like this:
127.0.0.1 ble.local
127.0.0.1 api.ble.local
then try replacing proxy_pass http://127.0.0.1:3000;
with
proxy_pass http://api.ble.local:3000;
Here's My
nginx
configurationand here's my router with subdomain support
The problem is that it's rendering the index route
and for sure i setup-ed the
hosts
fileI've been searching for 3 hrs can you help me :)