A page that tells you what the web server sees about your request: your address and port, the IP version, whether the connection is encrypted, the TLS parameters, the server address and name, the date, and the request headers.
This fork renders the page with nginx's native SSI module and no longer supports Apache. It lives at https://github.com/MaZderMind/testpage; the original Apache version lives at https://github.com/bernd289/testpage.
index.shtml, full.txt and ip.txt are Server Side Include templates.
nginx evaluates them in-process, so the same template produces correct HTML
and correct plain text. No sub_filter, no external process, no CSS tricks
to hide the branch that should not have been rendered.
-
nginx must be built with the SSI module. It is part of every standard build:
nginx -V 2>&1 | grep -q with-http_ssi_module && echo "SSI enabled"
-
Point a server at this directory.
ssi_typesis what makes the.txtendpoints work, since nginx only processestext/htmlby default:geo $ipversion { ::ffff:0:0/96 ipv4; ::0/0 ipv6; 0.0.0.0/0 ipv4; } server { listen 80; listen [::]:80; listen 443 ssl; listen [::]:443 ssl; http2 on; server_name test.example.com; root /var/www/testpage; index index.shtml; location / { ssi on; ssi_types text/plain; add_header Cache-Control "max-age=0, no-cache, no-store, must-revalidate" always; add_header Pragma "no-cache" always; add_header Expires "Mon, 1 Jan 2019 01:00:00 GMT" always; } }
geolives in thehttpcontext. Site configs included fromsites-enabled/already are, so it can sit at the top of the file. -
Endpoints:
Path Content /the HTML page /full.txtthe same information as plain text /ip.txtjust the client address
- No reverse DNS. nginx has no built-in reverse lookup, so
REMOTE_HOSTdoes not exist and the page does not show a DNS name at all. The client may well have one, this server just cannot see it. - No cipher key size. nginx exposes
$ssl_cipherbut no variable for the negotiated key size, so the "… bit" part is gone. - Values are escaped. nginx's
#echoHTML-escapes by default. That also closes the hole where Apache's version rendered aUser-Agentcontaining HTML markup verbatim. The.txttemplates opt out withencoding="none". $ipversioncomes fromgeo, not from a regex on the address, so thegeoblock above is required.
These run the upstream Apache version, not this fork:
- https://test.matthiashille.com (IPv4 only: https://test4.matthiashille.com, IPv6 only: https://test6.matthiashille.com)
- https://test.mazdermind.de (IPv4 only: https://test4.mazdermind.de, IPv6 only: https://test6.mazdermind.de)
- https://test.dssr.ch