设置应用程序URL前缀与枪支
由于多过程池支持,我目前正在将基于金字塔WSGI的应用程序从女服务员Web服务器移至Gunicorn Web服务器。
目前,该应用程序正在为女服务员提供:
from waitress import serve
serve(app,
host='127.0.0.1',
trusted_proxy="127.0.0.1",
threads=32,
port=port,
trusted_proxy_headers="forwarded",
url_scheme=scheme, # HTTPS
url_prefix='/api')
现在,我想与Gunicorn一起服务同一申请。我设法在Gunicorn上找到了所有匹配选项,但没有url_prefix
。设置应用程序URL前缀的枪支等效是什么(我认为这有时也称为应用程序根)?
I am currently moving Pyramid WSGI based application from the Waitress web server to Gunicorn web server due to multiprocess pooling support.
Currently, the application is being served with Waitress as:
from waitress import serve
serve(app,
host='127.0.0.1',
trusted_proxy="127.0.0.1",
threads=32,
port=port,
trusted_proxy_headers="forwarded",
url_scheme=scheme, # HTTPS
url_prefix='/api')
Now, I would like to serve the same application with Gunicorn. I managed to find all matching options on Gunicorn, but not url_prefix
. What is Gunicorn equivalent for setting the application URL prefix (I think this is sometimes also called application root)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一个人可以使用“ noreferrer”> script_name 环境在枪中的变量以配置WSGI应用程序根。
这是一个示例:
另请参见相关的caddfyfile 。
One can use SCRIPT_NAME environment variable in Gunicorn to configure the WSGI application root.
Here is an example:
See also related Caddfyfile.