server {
        server_name _;

        location / {
            uwsgi_pass 127.0.0.1:9001;
            include uwsgi_params;
            uwsgi_param     UWSGI_SCHEME $scheme;
        }

        location /user {
            rewrite ^ https://$http_host$request_uri? permanent;
        }

        location /admin {
            rewrite ^ https://$http_host$request_uri? permanent;
        }

        location /appadmin {
            rewrite ^ https://$http_host$request_uri? permanent;
        }

        location /static {
            root /var/web2py/applications/init/;
        }
    }

    server {
        listen 443;
        listen 127.0.0.1:8000;
        server_name _;
        ssl                  on;
        ssl_certificate      /opt/nginx/conf/ssl.crt;
        ssl_certificate_key  /opt/nginx/conf/ssl.key;

        location / {
            rewrite ^ http://$http_host$request_uri? permanent;
        }

        location /user {
            uwsgi_pass      127.0.0.1:9001;
            include         uwsgi_params;
            uwsgi_param     UWSGI_SCHEME $scheme;
        }

        location /admin {
            uwsgi_pass      127.0.0.1:9001;
            include         uwsgi_params;
            uwsgi_param     UWSGI_SCHEME $scheme;
        }

        location /appadmin {
            uwsgi_pass      127.0.0.1:9001;
            include         uwsgi_params;
            uwsgi_param     UWSGI_SCHEME $scheme;
        }

        location /static {
            root /var/web2py/applications/init/;
        }
    }
}

Reply via email to