webpagetest does not work for special port?

39 views Asked by At

I install NginX as a reverse proxy for Apache. Then set it to listen port(443) for https, and let Apache to listen port 8443 for https.

When visiting:

https://www.sample.com:443
https://www.sample.com:8443

via a normal browser such as Chrome, then both are OK.

But when using webpagetest to test the above two URLs, then the first one is OK. but the 2nd one will always return time-out error.

Why?

1

There are 1 answers

3
VonC On BEST ANSWER

From the setup described, you have Nginx set up as a reverse proxy to Apache, with Nginx listening on the standard HTTPS port (443) and Apache on port 8443. When clients connect to the standard port, the requests are properly forwarded through Nginx to Apache, and the website content is served as expected. However, when attempting to connect directly to Apache on port 8443, WebPageTest encounters a timeout error.

+---------+     +-----------+      +---------+     +------------+     +---------------+
| Client  | --> | Nginx:443 | -->  | Apache  | --> | Website    |     | WebPageTest   |
| Browser |     | (reverse  |      | :8443   |     | Content    | <-- | (timeout on   |
|         |     |  proxy)   |      |         |     |            |     |  :8443)       |
+---------+     +-----------+      +---------+     +------------+     +---------------+
                   |                                  |
                   |                                  |
                   +-----> Standard flow              +-----> Issue occurs here

First, make sure your firewall rules allow traffic on port 8443. If you are on Linux, for instance, sudo ufw allow 8443/tcp.

And try accessing https://sample.com:8443 from a different network or using a different tool to see if the issue persists.

curl -ILv https://sample.com:8443

Check your Apache setting: it must listen on port 8443, with a correct SSL/TLS configuration.

Listen 8443
<VirtualHost *:8443>
    SSLEngine on
    SSLCertificateFile /path/to/your/certificate.crt
    SSLCertificateKeyFile /path/to/your/private.key
    ...
</VirtualHost>

Check the WebPageTest documentation on private Web server install for any option which might have an impact on your setup.