Skip to content

Move nginx config files to subdirectory#1379

Merged
alxndrsn merged 6 commits intogetodk:masterfrom
alxndrsn:nginx-conf-location
Jan 13, 2026
Merged

Move nginx config files to subdirectory#1379
alxndrsn merged 6 commits intogetodk:masterfrom
alxndrsn:nginx-conf-location

Conversation

@alxndrsn
Copy link
Contributor

@alxndrsn alxndrsn commented Oct 22, 2025

What has been done to verify that this works as intended?

Nothing - I can't currently start nginx locally from the Procfile.

Why is this the best possible solution? Were any other approaches considered?

Discussed at #1376 (comment)

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

No change - dev only.

Does this change require updates to user documentation? If so, please file an issue here and include the link below.

No - the change is dev only.

Before submitting this PR, please make sure you have:

  • run npm run test and npm run lint and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code or assets from external sources are properly credited in comments or that everything is internally sourced

* tidy up the repo a little
* prepare for potential changes to the config in e.g. getodk#1376
@alxndrsn alxndrsn marked this pull request as ready for review October 22, 2025 12:15
Copy link
Member

@matthew-white matthew-white Oct 27, 2025

Choose a reason for hiding this comment

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

Given that the command in the Procfile is still -p "$PWD", do any file paths need to change in main.nginx.conf? For example, for something like:

include ./common-headers.nginx.conf;

Isn't ./ still the top-level directory of the repository? I'm wondering whether that line needs to change to:

include ./nginx-conf/common-headers.nginx.conf;

Or are include paths relative to the config file rather than the -p path?

Would it help anything to change the -p path to "$PWD/nginx-conf"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there any chance you could give this branch a quick try? Given the motivation for this PR was #1376, which was motivated by not being able to run nginx -p in the first place...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@matthew-white did you get a chance to test this?

Copy link
Member

Choose a reason for hiding this comment

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

Just tried it, sorry for the delay! It's working. 🥳 I guess that means that some paths in the config file are relative to the -c path, not the -p path. That's good to know.

When I run npm run dev and load Frontend locally, I see:

  • A new nginx.pid file is created. That indicates that the pid directive is working.
  • New entries are added to nginx-access.log. That indicates that the access_log directive is working.
  • The response headers in common-headers.nginx.conf are returned. That indicates that the include directive is working.

What I didn't check:

  • alias ./dist/blank.html; for /-/single/check-submitted. Conceptually, it makes sense to me that alias would be relative to the -p path. We can always change it if that turns out to be wrong.
  • client_body_temp_path and proxy_temp_path. Again, it makes sense to me that those would be relative to the -p path. pid and access_log are both still working and similarly write to files in the .nginx directory.
  • npm run dev:build didn't work, so I wasn't able to check whether root ./dist; works as intended. However, it looks like npm run dev:build is broken on the master branch as well. I can file an issue about that. I almost always use npm run dev, which is probably why I hadn't noticed this already. I don't think this issue needs to block this PR from being merged.

Copy link
Member

Choose a reason for hiding this comment

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

it looks like npm run dev:build is broken on the master branch as well. I can file an issue about that.

Filed at getodk/central#1606.

Copy link
Member

Choose a reason for hiding this comment

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

... and now I've closed the issue after realizing that npm run dev:build is working after all. I've confirmed that it works on the current master branch, which means that it plays well with the changes from this PR. It also indicates that root ./dist; is working correctly. That implies that root operates relative to the -p path, which makes sense.

Copy link
Member

@matthew-white matthew-white left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for making this change! It definitely feels tidier compared to having the config files at the top level of the repo.

@alxndrsn alxndrsn merged commit 580786c into getodk:master Jan 13, 2026
5 checks passed
@alxndrsn alxndrsn deleted the nginx-conf-location branch February 3, 2026 08:49
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.

2 participants