Skip to content

Support for plain nginx test backend #375

Description

@margau

Description

Providing an nginx configuration to act as basic test backend

Why it should be implemented

No further service needed, which allows a small-footprint test endpoint on "light" systems. For my side, I'm planning to deploy this on routers at different locations. Nginx is available, but I wanna to avoid setting up separate services trough the network

Implementation suggestions

Prototype with the provided nginx configuration is available under https://speedtest.margau.net (IPv6 only)

The only thing missing is the upload test, which i unfortunately not got working by now.

server {
  listen [::]:443 ssl http2 default_server ipv6only=off;

[...]
    location /speedtest/empty {
      client_max_body_size 256M;
      add_header Access-Control-Allow-Origin "*";
      add_header Access-Control-Allow-Methods "GET, POST";
      add_header Access-Control-Allow-Headers "Content-Encoding, Content-Type";
      add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0, s-maxage=0'";
      add_header Cache-Control "post-check=0, pre-check=0";
      add_header Pragma no-cache;
      return 200;
    }
    location /speedtest/dl {
      add_header Access-Control-Allow-Origin "*";
      add_header Access-Control-Allow-Methods "GET, POST";
      add_header Access-Control-Allow-Headers "Content-Encoding, Content-Type";
      alias /var/www/edge.as213204.net/html/test/100m.bin;
    }
    location /speedtest/ip {
      add_header Access-Control-Allow-Origin "*";
      add_header Access-Control-Allow-Methods "GET, POST";
      add_header Access-Control-Allow-Headers "Content-Encoding, Content-Type";
      types { } default_type "application/json; charset=utf-8";
      return 200 '
        {"processedString":"$remote_addr","rawIspInfo":""}
      ';
    }

[...]
}

If I manage to solve the upload test issue, I'll happily provide an PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions