何时在金字塔中使用route_url或route_path?

2024-04-26 13:27:47 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个问题与路线的网址和我的设置。在服务器上,我有一个paster服务器,它监听端口6543上的127.0.0.1,还有一个nginx服务器,它从端口80反向代理到端口6543。在

我还使用粘贴前缀在ini文件中检索具有此设置的真实客户端IP:

[filter:paste_prefix]
use = egg:PasteDeploy#prefix

[pipeline:main]
pipeline = 
  paste_prefix
  myapp

服务器位于专用LAN上,我正试图通过SSH隧道连接到服务器,该隧道设置如下:

^{pr2}$

我连接到客户机上的网页,网址是:http://localhost:8080

主页显示正确,但所有链接生成request.route\u网址正在重定向到localhost/url(不带:8080)。 我想这可能与nginx或paste prefix(或两者)有关。在

我希望用route_path替换route_url可能会在不修复nginx/ini设置问题的情况下解决这个问题。在

有没有理由调用route_url而不是route_path?在


Tags: path端口服务器localhosturlprefixpipelinenginx