Skip to content

Commit

Permalink
https: T6734: Nginx - disable software version reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
mwheeler1982 committed Jan 6, 2025
1 parent 53cb3e5 commit 3b80955
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data/templates/https/nginx.default.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ server {
listen [::]:{{ port }} ssl;
{% endif %}

server_tokens {{ 'on' if server_version_id is vyos_defined and server_version_id == 'enable' else 'off' }};

server_name {{ hostname }};
root /srv/localui;

Expand Down
20 changes: 20 additions & 0 deletions interface-definitions/service_https.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,26 @@
<defaultValue>1.2 1.3</defaultValue>
</leafNode>
#include <include/interface/vrf.xml.i>
<leafNode name='server-version-id'>
<properties>
<help>Show version on error pages and in the Server response header field.</help>
<completionHelp>
<list>enable disable</list>
</completionHelp>
<valueHelp>
<format>enable</format>
<description>Enable webserver version reporting</description>
</valueHelp>
<valueHelp>
<format>disable</format>
<description>Disable webserver version reporting</description>
</valueHelp>
<constraint>
<regex>(enable|disable)</regex>
</constraint>
<defaultValue>disable</defaultValue>
</properties>
</leafNode>
</children>
</node>
</children>
Expand Down

0 comments on commit 3b80955

Please sign in to comment.