HTTP Static Server¶
TNSR includes a basic HTTP server for static content. This functionality is required internally for certain configurations, but is also available to users who may find it helpful.
Warning
The HTTP Static server is not intended to be a public web server.
The HTTP Static server does not support encryption (TLS/HTTPS).
HTTP Static Server Configuration¶
To configure the HTTP Static server, start in config mode and use the
http_static command to enter config-http-static mode.
- address <ip-addr>
IP address on which the HTTP Static server will respond to HTTP requests.
This parameter is mandatory and there is no default value. Use
0.0.0.0to listen on any IPv4 address or::to listen on any IPv6 address.- port <port>
TCP port on which the HTTP Static server will respond to HTTP requests.
This parameter is mandatory and there is no default value.
- root <directory>
Directory containing content for the HTTP Static server
This parameter is mandatory and there is no default value.
Note
The HTTP Static server does not support default files, requests must be exact. For example, a client cannot request
/, it must request/index.htmland theindex.htmlfile must exist in the root directory.
All three parameters are mandatory. When all three are present, the HTTP Static server is enabled.
To disable the HTTP Static server, remove the configuration with no
http_static.
HTTP Static Server Example¶
The following example configures the HTTP Static server to listen on any IPv4
address using port 80 and serving content from the /srv directory on
the TNSR installation:
tnsr(config)# http_static
tnsr(config-http-static)# address 0.0.0.0
tnsr(config-http-static)# port 80
tnsr(config-http-static)# root /srv
tnsr(config-http-static)# exit
HTTP Static Server Status¶
To view the status of the HTTP Static server, use show http_static:
tnsr(config)# show http_static
Enabled: true
Root: /srv
Bind address: 0.0.0.0
Port: 80
The service cannot be stopped or started individually.