Skip to content

optimize set nginx conf env#2174

Merged
spacewander merged 8 commits into
apache:masterfrom
dickens7:optimze-config
Sep 14, 2020
Merged

optimize set nginx conf env#2174
spacewander merged 8 commits into
apache:masterfrom
dickens7:optimze-config

Conversation

@dickens7

@dickens7 dickens7 commented Sep 7, 2020

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

I need to get env variables in the plugin so I need to set nginx conf environment variables

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible?

Comment thread conf/config-default.yaml Outdated
event:
worker_connections: 10620
envs:
- TEST

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can add APISIX_PROFILE as the default.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I changed my idea. We should always include APISIX_PROFILE.
Since the TEST is useless now, we should comment it out and just let it as an example.

@spacewander

Copy link
Copy Markdown
Member

Comment thread conf/config-default.yaml Outdated
event:
worker_connections: 10620
envs:
- APISIX_PROFILE

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since default configure can be overridden by the user, I think we should always include APISIX_PROFILE in the nginx.conf template. Otherwise, APISIX_PROFILE might be lost by mistake. We can leave a comment here as example.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

From the definition of APISIX_PROFILE, you are right. But I think this configuration should be defined in the configuration file instead of environment variables. I think can use the environment variable definition part of the configuration. When there is a corresponding environment variable definition, the environment variable is preferred

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the above are my thoughts. i modifyd a version first will not cover APISIX_PROFILE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants