Skip to content

Add possibility to change default vhost port #101

@songsfromthewood

Description

@songsfromthewood

Hello!

Thank for this repo. What do you think about possibility to change default vhost port using ENV variable?
Here is example with NGINX_VHOST_PORT`

`
diff --git a/templates/vhost.conf.tmpl b/templates/vhost.conf.tmpl
index a290042..cb3a3a7 100644
--- a/templates/vhost.conf.tmpl
+++ b/templates/vhost.conf.tmpl
@@ -1,7 +1,7 @@
include upstream.conf;

server {
- listen 80 default_server{{- if getenv "NGINX_HTTP2" }} http2{{- end }};
+ listen {{ getenv "NGINX_VHOST_PORT" "80" }} default_server{{- if getenv "NGINX_HTTP2" }} http2{{- end }};
server_name {{ getenv "NGINX_SERVER_NAME" "default" }};

 root {{ getenv "NGINX_SERVER_ROOT" "/var/www/html" }};

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions