suchen

Heim  >  Fragen und Antworten  >  Hauptteil

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

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

PHPzPHPz2875 Tage vor445

Antworte allen(1)Ich werde antworten

  • PHPz

    PHPz2017-04-17 15:51:11

    nginx的问题
    加下面一句就好了

    proxy_set_header Host $host;

    Antwort
    0
  • StornierenAntwort