Flask 404 when using SERVER_NAME

后端 未结 1 1600
甜味超标
甜味超标 2021-02-14 02:44

In my Flask config, I\'m setting SERVER_NAME to a domain like \"app.example.com\". I\'m doing that because I need to use url_for with _external URLs.

1条回答
  •  北荒
    北荒 (楼主)
    2021-02-14 03:32

    Just found the answer. Apache has an option called ProxyPreserveHost. Once it's set to On, everything works as expected.

    More information here: http://flask.pocoo.org/mailinglist/archive/2011/3/14/problem-with-apache-proxy-and-canonical-urls/

    0 讨论(0)
提交回复
热议问题