Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

2.6 KB
Raw Blame
server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name _;

    root /usr/share/nginx/html;
    index index.html;

    # ── httpbin-compatible redirect chain ────────────────────────────
    # Mimics https://httpbin.org/redirect/N → eventually /get.
    # Used by e2e tests that exercise the navigate handler's
    # redirect-following without depending on external internet.
    location = /redirect/1 { return 302 /get; }
    location = /redirect/2 { return 302 /redirect/1; }
    location = /redirect/3 { return 302 /redirect/2; }
    location = /redirect/4 { return 302 /redirect/3; }
    location = /redirect/5 { return 302 /redirect/4; }

    # httpbin-compatible /redirect-to?url=…: 302 to whatever the caller asks.
    # NOTE: stock nginx returns $arg_url *raw*, without URL-decoding, so a
    # caller passing url=http%3A%2F%2Fexample.com%2F gets a Location header
    # with the encoded value, which most clients then re-resolve as a
    # relative path. For percent-encoded targets use /redirect-to-internal
    # below instead.
    location = /redirect-to {
        return 302 $arg_url;
    }

    # SSRF test target: always redirects to a private/internal IP. Used by
    # files-basic / files-extended "redirected internal target blocked" tests
    # to verify the download handler blocks redirects to internal hosts
    # without needing a parameterized target (which would require nginx
    # to URL-decode query args, something stock nginx can't do).
    location = /redirect-to-internal {
        return 302 http://127.0.0.1:9999/health;
    }

    # httpbin-compatible /get: returns a JSON body whose .url field
    # reflects the final landed URL (host included so tests can assert).
    location = /get {
        default_type application/json;
        return 200 '{"url":"http://fixtures/get"}';
    }

    # Default: serve the static fixture files.
    location / {
        try_files $uri $uri/ =404;
    }
}

# Dedicated vhost for the scrape fixture. seaportal's crawler seeds discovery
# from the host ROOT (scheme://host/), not the given path, so a scrape fixture
# living in a subdirectory of the shared `fixtures` host is never reached. This
# vhost roots the `scrapesite` hostname at the scrape-site/ subdirectory so a
# crawl of http://scrapesite/ discovers exactly the scrape fixture pages.
# Reached via the `scrapesite` network alias on the fixtures service.
server {
    listen 80;
    listen [::]:80;
    server_name scrapesite;

    root /usr/share/nginx/html/scrape-site;
    index index.html;

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