librespeed/speedtest-go

Not working properly after Caddy2

wsndshx opened this issue · 4 comments

Description

I use Caddy2 to forward access on port 443 to port 8989. I can open the page but cannot perform speed testing.

###Caddy Config

speedtest.example.com {
    encode gzip
    root * /speedtest-go/assets
    file_server
    reverse_proxy / localhost:8989 {
        header_up -Origin
    }
}

###speedtest settings
speedtest settings are the default

Client

Browser: Chrome 86.0.4240.183,
OS: Window 10

Steps to reproduce

  • Click to start.
  • Unable to measure download speed.

Expected behaviour

The file should be downloaded from the server and the speed measured.

Screenshots

Snipaste_2020-11-05_22-44-08

I'm not sure about Caddy's configuration, maybe try to remove the root * /speedtest-go/assets line? And what does the file_server line do?

The assets should be served by the Go backend instead of Caddy, so can just forward all requests to the backend.

I'm not sure about Caddy's configuration, maybe try to remove the root * /speedtest-go/assets line? And what does the file_server line do?

The assets should be served by the Go backend instead of Caddy, so can just forward all requests to the backend.

root * /speedtest-go/assets and file_server are used to indicate the root directory of the site and allow it to access static files (js). After deleting them, the website seems to become a static page with no response.

This seems to be a problem with caddy's handling of URLs. I will try other reverse proxy solutions.

Here's an Nginx configuration FYR.

这是Nginx配置的FYR。

I found out that my configuration file was wrong.(orz)

I modified the configuration file to the following so that it can run normally.

speedtest.example.com {
    encode gzip
    reverse_proxy localhost:8989
}