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

Consolidate local/prod nginx conf & deploy scripts #3571

Closed
1 task
tristan-orourke opened this issue Aug 3, 2022 · 7 comments
Closed
1 task

Consolidate local/prod nginx conf & deploy scripts #3571

tristan-orourke opened this issue Aug 3, 2022 · 7 comments
Labels
debt Refactor or improve existing code.

Comments

@tristan-orourke
Copy link
Member

tristan-orourke commented Aug 3, 2022

Split off from #2834

We now have two nearly ngnix config files: infrastructure/conf/nginx-conf-deploy/default and infrastructure/conf/nginx-conf-local/default. The former is used by Azure DevOps, the latter by our local dev Docker container. It would be preferable to maintain only a single file. (We could use ENV:APP_ENV as a condition for certain rewrites if we only want them available locally.)

Screenshot

image

Possible Implementation

  • The setup.sh script could could add debugging lines to a base file
  • The post_deploy.sh script could remove debugging lines from a base file (probably less safe)

Acceptance Criteria

  • A single Nginx conf file works as a base for routing both locally and in Azure
@patcon
Copy link
Contributor

patcon commented Aug 4, 2022

Suggested first-step, collapse all our htaccess into one file. This aligned with what needs to happen for nginx (which has no concept of per-folder config)
re: todos in #3560

EDIT: Discussed in backlog grooming (tristan, vachan, brinda, patcon), and realized that this is best left to another issue.

@petertgiles petertgiles mentioned this issue Nov 14, 2022
12 tasks
@mnigh mnigh changed the title Consolidate local/prod htaccess & deploy scripts Consolidate local/prod nginx conf & deploy scripts Jan 10, 2023
@mnigh
Copy link
Contributor

mnigh commented Dec 13, 2023

@GCTC-NTGC/developers is there still interest in moving ahead with this issue? the two files seem to have quite a few differences between them.

Screenshot

Screen Shot 2023-12-13 at 09 40 13

@esizer
Copy link
Member

esizer commented Dec 13, 2023

@GCTC-NTGC/developers is there still interest in moving ahead with this issue? the two files seem to have quite a few differences between them.

Since we do need different configs (i think) I don't think we can get away with having only one file. But, we could have a common file so we don't need to duplicate similar definitions and then use include to add the additional items for each env.

@tristan-orourke
Copy link
Member Author

Looks like the differences are...

  • enable logging on local
  • never cache locally
  • a few cases of hardcoding locally when we could use an env variable instead
  • extra blocks for local auth, phpinfo and xdebuginfo

@tristan-orourke
Copy link
Member Author

Is it really necessary to never cache locally? Especially if we keep cache times reasonably short, eg 1 minute.

I like @esizer's suggestion of a comment file and include statements for the extra blocks. Would be easier if we referenced env variables on local in the same places we do in the prod script.

@petertgiles
Copy link
Contributor

I'd like to continue to keep them separate. They're never going to match exactly and as long as the two files live close together it's easy enough to diff them and make sure they don't drift apart. If we start dynamically building them it will just make it harder to read and manage them.

@tristan-orourke
Copy link
Member Author

tristan-orourke commented Dec 13, 2023

Fair enough.
Closed for: wise words from @petertgiles

@tristan-orourke tristan-orourke closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Refactor or improve existing code.
Projects
None yet
Development

No branches or pull requests

5 participants