Repository navigation
Adding Custom NGINX info provided by Jacob. #1197
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e740150
adding Custom NGINX info provided by Jacob.
Chr1st0ph3rTurn3r 8276d29
adding config to preserve custom nginx file
Chr1st0ph3rTurn3r e63b574
Merge branch 'master' into DOCS-584-nginx
Chr1st0ph3rTurn3r 038d128
updating instructions with info for saving the custom file.
Chr1st0ph3rTurn3r File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| --- | ||
| title: Add Custom NGINX Configuration | ||
| sidebar_label: Add Custom NGINX Configuration | ||
| --- | ||
|
|
||
| Custom NGINX directives may be needed to support deployment-specific requirements or integrations without modifying the SSR-managed `nginx.conf` file. For example, custom directives can be used to integrate external authentication services such as CAC/PIV, add request handling behavior, or apply other supported NGINX settings. | ||
|
|
||
| Use `/etc/nginx/default.d/` to add persistent custom NGINX directives to an SSR Conductor. | ||
|
|
||
| Do not modify `/etc/nginx/nginx.conf` directly. SSR manages this file and may regenerate it during system startup or other operations. | ||
|
|
||
| ## Add the Configuration | ||
|
|
||
| 1. Create a `.conf` file in `/etc/nginx/default.d/` containing only the required NGINX directives. Do not add a `server` block. For example: | ||
|
|
||
| ``` | ||
| sudo tee /etc/nginx/default.d/zz-custom.conf >/dev/null <<'EOF' | ||
| # Custom NGINX directives | ||
| auth_request /oauth2/auth; | ||
| error_page 401 = /oauth2/sign_in; | ||
| auth_request_set $auth_user $upstream_http_x_auth_request_user; | ||
| EOF | ||
| ``` | ||
| 2. To preserve your custom NGINX file across image-based upgrades, create a data-transfer configuration file in `/etc/ssr-upgrade/data-transfer.d/`. For example: | ||
|
|
||
| ``` | ||
| sudo tee /etc/ssr-upgrade/data-transfer.d/90-custom-nginx.yml >/dev/null <<'EOF' | ||
| version: "2.1" | ||
| data: | ||
| - dataset: Custom NGINX configuration | ||
| operations: | ||
| - upgrade | ||
| - reinstall | ||
| files: | ||
| - /etc/nginx/default.d/zz-custom.conf | ||
| EOF | ||
| ``` | ||
| 3. Validate the configuration: | ||
|
|
||
| ``` | ||
| sudo nginx -t | ||
| ``` | ||
|
|
||
| 4. If validation succeeds, reload NGINX: | ||
|
|
||
| ``` | ||
| sudo systemctl reload nginx | ||
| ``` | ||
|
|
||
| 5. Confirm that the custom file is included: | ||
|
|
||
| ``` | ||
| sudo nginx -T 2>&1 | grep -n "zz-custom.conf" | ||
| ``` | ||
|
|
||
| ## Remove the Configuration | ||
|
|
||
| 1. Remove the custom file: | ||
|
|
||
| ``` | ||
| sudo rm -f /etc/nginx/default.d/zz-custom.conf | ||
| ``` | ||
|
|
||
| 2. Validate and reload NGINX: | ||
|
|
||
| ``` | ||
| sudo nginx -t | ||
| sudo systemctl reload nginx | ||
| ``` | ||
|
|
||
| :::note | ||
| If `nginx -t` reports an error, review the custom directives for invalid syntax, unsupported directives, or an incorrect configuration context. | ||
| ::: | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will these files persist an upgrade, or do they also need to be added to the phoenix manifest to ensure they are copied between volumes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, I don't think this directory is currently covered so that's a good call-out. in lieu of a "preserving custom files across image-based upgrades" page I think the following config would transfer the nginx file,