Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

support nginx_* env variables on nginx container and vhosts#1326

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
poma wants to merge1 commit intonginx-proxy:main
base:main
Choose a base branch
Loading
frompoma:master

Conversation

poma
Copy link

@pomapoma commentedSep 5, 2019
edited
Loading

Implementation of#1324 feature request. Environment variables starting withnginx_* are added as nginx config statements, for example:nginx_client_max_body_size=30M. Variables of jwilder/nginx-proxy container are added to the global config, and variables on others containers are added to the respective vhosts.

Exampledocker-compose.yml:

version:'2.1'services:nginx:image:jwilder/nginx-proxyports:      -80:80      -443:443volumes:      -/var/run/docker.sock:/var/run/docker.sock:roenvironment:nginx_client_max_body_size:42Mapp:image:appenvironment:VIRTUAL_HOST:example.comnginx_client_max_body_size:1337M

Currently only lower case variables are supported (untilnginx-proxy/docker-gen#306 is merged). Also if there is an easy way to mergeEnv dicts from all containers with the same vhost, we should do that, currentlyEnv map is taken from the first container for each vhost.

olexs, sgabe, PejmanNik, and yutin1987 reacted with thumbs up emoji
@pnbecker
Copy link

I like this PR and think it would be a helpful addition.

@poma
Copy link
Author

While we are waiting for this to be merged, you can use updated docker-gen from the repopoma/docker-gen that already contains this PR

@buchdagbuchdag added kind/feature-requestIssue requesting a new feature status/pr-needs-testsThis PR needs new or additional test(s) status/pr-needs-docsThis PR needs new or additional documentation labelsApr 5, 2021
@buchdagbuchdag added type/featPR for a new feature and removed kind/feature-requestIssue requesting a new feature labelsApr 29, 2021
@buchdagbuchdag self-assigned thisAug 8, 2021
@poma
Copy link
Author

Rebased PR onto the current master, now also supports upper case "NGINX_*" env vars.

One problem I've encountered is that some containers export export "NGINX_*" env vars that are invalid in the context of nginx conf and this might lead to broken nginx config generation. Notablynginx:alpine exports NGINX_VERSION which is an invalid in nginx config, this might happen if you want to put another nginx instance behind the main nginx proxy. There is a workaround of overriding exported value with an empty string. But it's still a breaking change that can break a working server when people update to it, so be careful.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@buchdagbuchdag

Labels
status/pr-needs-docsThis PR needs new or additional documentationstatus/pr-needs-testsThis PR needs new or additional test(s)type/featPR for a new feature
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@poma@pnbecker@buchdag

[8]ページ先頭

©2009-2025 Movatter.jp