Openerp web通过ip可以访问,但是通过nginx proxy(域名访问)过来就出错
-
很是奇怪,通过IP和端口直接访问cherrypy没有问题,但是通过域名访问,id及ids在保存单据后的查询下面数值后面会多出来:,不知道谁碰到过同样的问题,谢谢。
下面是我跟踪到的信息。
文件后缀修改为txt。
[[i] 本帖最后由 chengwenge 于 2010-2-20 17:40 编辑 [/i]]
-
URL是有问题的,id,ids有的整数后面多了个: 号,但是IP访问就是正确的。
和程序本身应该是没有关系。 -
[quote]原帖由 [i]chengwenge[/i] 于 2010-2-20 12:21 发表 www.shine-it.net/redirect.php?goto=findpost&pid=3952&ptid=865
URL是有问题的,id,ids有的整数后面多了个: 号,但是IP访问就是正确的。
和程序本身应该是没有关系。 [/quote]你从哪里开始看到多了个 : 号? 还不是 Python 的LOG里有. 你确认那个 ":" 是URL带来的? 都给你讲了. 别那么肯定.
PS:我同 oldrev 一样. 也玩了 Apache SSL 的 Proxy 不过不是代理的 OE. 因为OE还没有完全走通.
-
我跟踪了 cherrypy的 _cpwsgi.py
def get_response(self):
"""Run self.request and return its response."""
meth = self.environ['REQUEST_METHOD']
path = _http.urljoin(self.environ.get('SCRIPT_NAME', ''),
self.environ.get('PATH_INFO', ''))
qs = self.environ.get('QUERY_STRING', '')
#cwg add
print "before"
print qs
qs=qs.rstrip(":")
#qs=qs.replace(":%20","")
print "after"
print qs通过IP访问的 qs:
count=154&domain=[]&search_domain=&ids=[239,%20233,%20232,%20231,%20230,%20229,%20228,%20227,%20226,%20225,%20224,%20223,%20222,%20221,%20220,%20219,%20218,%20217,%20216,%20215,%20214,%20213,%20212,%20211,%20210,%20209,%20208,%20207,%20203,%20205,%20204,%20202,%20201,%20200,%20199,%20198,%20197,%20196,%20195,%20206,%20194,%20192,%20191,%20193,%20190,%20189,%20188,%20187,%20186,%20185,%20184,%20183,%20182,%20179,%20178,%20177,%20176,%20175,%20174,%20173,%20172,%20171,%20170,%20169,%20168,%20167,%20166,%20165,%20164,%20163,%20162,%20161,%20160,%20151,%20159,%20158,%20157,%20156,%20155,%20154]&view_mode=[u%27tree%27,%20u%27form%27,%20u%27calendar%27,%20u%27graph%27]&limit=80&context={%27lang%27:%20u%27zh%27,%20%27active_ids%27:%20[322],%20%27tz%27:%20u%27%27,%20%27client%27:%20%27web%27,%20%27active_id%27:%20322}&offset=0&model=sale.order&view_ids=[False,%20False,%20False,%20False]&id=239通过域名访问的 qs:
count=154&domain=[]&search_domain=&ids=[239,%20233,%20232,%20231,%20230,%20229,%20228,%20227,%20226,%20225,%20224,%20223,%20222,%20221,%20220,%20219,:%20%20218,%20217,%20216,%20215,%20214,%20213,%20212,%20211,%20210,%20209,%20208,%20207,%20203,%20205,%20204,:%20%20202,%20201,%20200,%20199,%20198,%20197,%20196,%20195,%20206,%20194,%20192,%20191,%20193,%20190,%20189,:%20%20188,%20187,%20186,%20185,%20184,%20183,%20182,%20179,%20178,%20177,%20176,%20175,%20174,%20173,%20172,:%20%20171,%20170,%20169,%20168,%20167,%20166,%20165,%20164,%20163,%20162,%20161,%20160,%20151,%20159,%20158,:%20%20157,%20156,%20155,%20154]&view_mode=[u%27tree%27,%20u%27form%27,%20u%27calendar%27,:%20%20u%27graph%27]&limit=80&context={%27lang%27:%20u%27zh%27,%20%27active_ids%27:%20[322],%20%27tz%27:%20u%27%27,%20%27client%27:%20%27web%27,%20%27active_id%27:%20322}&offset=0&model=sale.order&view_ids=[False,%20False,%20False,%20False]&id=239:通过处理最后的:,能解决部分问题,但是其它的还是有错误,郁闷。
-
哈哈哈,终于解决了,春节期间都花了3天时间。原因不清楚,根据错误情况进行特殊处理,如下:
修改 cherrypy 的 _cpwsgi.py 的 def get_response(self):
"""Run self.request and return its response."""
meth = self.environ['REQUEST_METHOD']
path = _http.urljoin(self.environ.get('SCRIPT_NAME', ''),
self.environ.get('PATH_INFO', ''))
qs = self.environ.get('QUERY_STRING', '')
#cwg add
print "before"
print qs
[color=Red] qs=qs.rstrip(":")[/color]
[color=Red] qs=qs.replace(":%20%20","%20")[/color]
print "after"
print qs