nginx: configurable listen ip addresses

Based by idea of pikvm/pikvm#189
This commit is contained in:
Maxim Devaev
2025-05-03 18:50:09 +03:00
parent 6dea594380
commit 334b9f7d7b
3 changed files with 18 additions and 9 deletions

View File

@@ -39,9 +39,9 @@ http {
% if https_enabled:
server {
listen ${http_port};
listen ${http_ipv4}:${http_port};
% if ipv6_enabled:
listen [::]:${http_port};
listen [${http_ipv6}]:${http_port};
% endif
include /etc/kvmd/nginx/certbot.ctx-server.conf;
location / {
@@ -54,9 +54,9 @@ http {
}
server {
listen ${https_port} ssl;
listen ${https_ipv4}:${https_port} ssl;
% if ipv6_enabled:
listen [::]:${https_port} ssl;
listen [${https_ipv6}]:${https_port} ssl;
% endif
http2 on;
include /etc/kvmd/nginx/ssl.conf;
@@ -67,9 +67,9 @@ http {
% else:
server {
listen ${http_port};
listen ${http_ipv4}:${http_port};
% if ipv6_enabled:
listen [::]:${http_port};
listen [${http_ipv6}]:${http_port};
% endif
include /etc/kvmd/nginx/certbot.ctx-server.conf;
include /etc/kvmd/nginx/kvmd.ctx-server.conf;