server {
    listen  80;
    listen  [::]:80;
    server_name passport-fake-services.passport-load.passport.yandex.net;
    root /usr/lib/yandex/passport-fake-services/www/;
    autoindex on;

    rewrite ^/social/api/user/(.*)/profile(.*)$ /social/api/profiles last;

    location = /blackbox/ {
        if ($arg_method ~ "^(?:oauth)$") {
           rewrite ^.*$ /blackbox/$arg_method last;
        }

        proxy_set_header Host pass-load.sezam.yandex.net;
        proxy_pass http://pass-load.sezam.yandex.net;
    }

    location = /1/events/ {
        rewrite ^.*$ /historydb/events last;
    }

    location = /2/events/ {
        rewrite ^.*$ /historydb/events last;
    }

    location = /3/auths/aggregated/ {
        rewrite ^.*$ /historydb/auths/aggregated last;
    }


    location = /drive/api/staff/head/session {
        echo_sleep 0.300;
        echo '{';
        echo '  "session_id": "22222222222222222222222222222222"';
        echo '}';
    }

    location / {
        try_files $uri $uri/;
    }
}
