These are chat archives for cherrypy/cherrypy

Oct 2018
Oct 18 2018 03:25
@webknjaz for nginx or cherrypy?
Here's the nginx config.
upstream apps {

server {
    listen 80 default_server;
    client_max_body_size 500M;

    access_log /var/log/site/access.log;
    error_log /var/log/site/error.log;

    location / {
        proxy_pass http://apps;
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Host $server_name;
configuration = {
            'server.socket_host': '',
            'server.socket_port': 30114,
            'tools.sessions.on': True,
            'tools.sessions.timeout': 1440,
            'server.thread_pool': 20,
            'server.thread_pool_max': -1,
            'tools.proxy.on': config.tools_proxy_on,
            'tools.proxy.base': config.tools_proxy_base
            'tools.secureheaders.on': False,
            'tools.staticdir.root': config.tools_staticdir_root
        '/js': {
            'tools.staticdir.dir': "js"
            'tools.staticdir.dir': "css"
            'tools.staticdir.dir': "img"
            'tools.staticdir.dir': "jtable"
            'tools.staticdir.dir': "bootstrap"
            'tools.staticdir.dir': "main/dist",
            'tools.staticdir.index': "index.html"
            'tools.staticfile.filename': config.favicon
Sviatoslav Sydorenko
Oct 18 2018 22:31
@the7erm try 'tools.proxy.remote': 'X-Real-IP', this should do what you want.
    cherrypy.request.remote.ip (the IP address of the client) will be
    rewritten if the header specified by the 'remote' arg is valid.
    By default, 'remote' is set to 'X-Forwarded-For'. If you do not
    want to rewrite remote.ip, set the 'remote' arg to an empty string.