Does nginx offer a way to add the hostname (and port) in an HTML file (without using other solutions, such as PHP)?
May be SSI is what you are looking for?
All variables, which available in core module also available in ssi module.
Usage example:
<!--# echo var="host" default="unknown_host" -->:<!--# echo var="server_port" default="unknown_port" -->
I had put this string inside test.html and invoke this page through http://localhost/test.html
As a result I get following string:
localhost:80
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With