search

Home  >  Q&A  >  body text

node.js - node express 获取host出错的问题

http://xxx.cn/frontend_servic...
使用req.hostname获取
本地调试能正常的取到localhost
可是到真实环境下取到的却是frontend_service
求解

PHPzPHPz2875 days ago448

reply all(1)I'll reply

  • PHPz

    PHPz2017-04-17 15:51:11

    nginx problem
    Just add the following sentence

    proxy_set_header Host $host;

    reply
    0
  • Cancelreply