Nginx proxy for Apache error

60 views
Skip to first unread message

Nguyen Minh Tuan

unread,
Sep 17, 2015, 10:26:36 PM9/17/15
to web2py-users
Hi,

I setup Web2py with Apache successfully, but when I setup a Nginx proxy for Apache server I get error :

-----------------------------------------------
<type 'exceptions.TypeError'>(getattr(): attribute name must be string)
Traceback (most recent call last):
  File "C:\web2py\gluon\main.py", line 436, in wsgibase
    session.connect(request, response)
  File "C:\web2py\gluon\globals.py", line 960, in connect
    session_pickled = pickle.dumps(self, pickle.HIGHEST_PROTOCOL)
  File "C:\web2py\gluon\storage.py", line 56, in <lambda>
    getnewargs = lambda self: getattr(dict,self).__getnewargs__(self)
TypeError: getattr(): attribute name must be string
-----------------------------------------------

Environment :
- Web2py 2.11.2
- Apache 2.2.25
- Nginx 1.0.15

Nginx proxy setting :

upstream  qlkh {
        ip_hash;

        server 192.168.128.4:8080;
}

server {
 listen    80;

        location / {

  if ($request_uri ~* ".(jpg|jpeg|gif|gz|zip|flv|rar|wmv|avi|css|swf|png|htc|ico|mpeg|mpg|txt|mp3|mov|js)(\?v=[0-9.]+)?$") {
   expires 30d;
   break;
  }

  proxy_set_header   Host   $host;
  proxy_set_header   X-Real-IP  $remote_addr;
  proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
  add_header X-Cache-Status $upstream_cache_status;

  proxy_pass   http://qlkh;
 }
}

Does anyone got this error? please help!

Thanks in advance!
Tuan.

Leonel Câmara

unread,
Sep 18, 2015, 3:40:56 AM9/18/15
to web2py-users
Why don't you setup web2py with nginx directly using uwsgi-emperor? There's no need to have apache involved.

Nguyen Minh Tuan

unread,
Sep 18, 2015, 4:35:19 AM9/18/15
to web...@googlegroups.com
Hi Leonel,

I want nginx will stand as proxy server.

Note : when I add more node in upstream, it works normally! 

On 18 September 2015 at 14:40, Leonel Câmara <leonel...@gmail.com> wrote:
Why don't you setup web2py with nginx directly using uwsgi-emperor? There's no need to have apache involved.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/MjovH5XnKVk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Niphlod

unread,
Sep 18, 2015, 5:20:43 AM9/18/15
to web2py-users
the problem is not nginx,. is apache!
Reply all
Reply to author
Forward
0 new messages