Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nginx): add optional environment variable to override NGINX default listen port #46

Merged
merged 1 commit into from
Feb 11, 2022

Conversation

nikAizuddin
Copy link
Contributor

Hi, I would like to add optional environment variable NGINX_HTTP_PORT to override NGINX default HTTP listen port.

I can't find other ways to change Saferwall UI's listen port, so I guess this is the only way?

@yassinrais yassinrais added the enhancement New feature or request label Feb 10, 2022
Copy link
Member

@ayoubfaouzi ayoubfaouzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Btw Nik, why would you need that ? you can always map the host port of your choice to the container port.

@nikAizuddin
Copy link
Contributor Author

Usually I may have 2 use cases during deployment, for example:

  1. Need to use network=host to preserve client's IP address in NGINX logs. If using port mapping, the client's IP becomes the container's gateway network IP. For example:

NGINX logs when using network=host:

192.168.1.11 - - [11/Feb/2022:09:00:15 +0000] "GET // HTTP/2.0" 200 615 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0"

NGINX logs when using port mapping:

10.0.2.100 - - [11/Feb/2022:09:03:30 +0000] "GET // HTTP/2.0" 304 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0"
  1. Prevent port conflict within a pod. For example if I create a pod and then include both Saferwall UI container and my own NGINX container, I can't make my NGINX listen to port 80.

@ayoubfaouzi
Copy link
Member

Thanks a lot @nikAizuddin, seems both valid uses cases. Thanks for your contribution !

@ayoubfaouzi ayoubfaouzi merged commit 6ce2827 into saferwall:main Feb 11, 2022
@nikAizuddin nikAizuddin deleted the nginx-add-listen-port-option branch February 12, 2022 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants