当前位置: 首页 > 工具软件 > quixote > 使用案例 >

quixote app with nginx fastcgi redirect problem

滑景胜
2023-12-01
[b]quixote app with nginx fastcgi redirect problem[/b]

if you want to run quixote app with nginx fastcgi
you need patch the publish.py file

search with "request.get_environ('PATH_INFO', '')"
then add below code after that code

if 'nginx' in request.get_environ('SERVER_SOFTWARE', '') and request.get_environ('PATH_INFO', '') == '':
path = request.get_environ('SCRIPT_NAME', '')
else:
path = request.get_environ('PATH_INFO', '') << this is original code


there is another way if you don't want change lib come from quixote
just rewrite function try_publish in you own publisher


change
path = request.get_environ('PATH_INFO', '')
to
path = request.get_environ('SCRIPT_NAME', '')


that code will fix quxiote redirect problem with nginx

the definition of SCRIPT_NAME and PATH_INFO
REQUEST_URI SCRIPT_NAME PATH_INFO
------------------------+------------------+-------------
/scripts/blog.rb/ /scripts/blog.rb /
/scripts/blog.rb/add /scripts/blog.rb /add
/scripts/blog.rb/view/1 /scripts/blog.rb /view/1
 类似资料:

相关阅读

相关文章

相关问答