@@ -29,10 +29,18 @@ NGINX_AUTH_LOCATION_LINK=${NGINX_CONF_DIR}/nginx_auth_location.conf
29
29
NGINX_KEYCLOAK_LOCATION_LINK=${NGINX_CONF_DIR} /nginx_keycloak_location_rt.conf
30
30
NGINX_KEYCLOAK_LOCATION_CONF=${NGINX_CONF_DIR} /nginx_keycloak_location.conf
31
31
32
+ # "include" file for embedded keycloak upstream
33
+ NGINX_KEYCLOAK_UPSTREAM_LINK=${NGINX_CONF_DIR} /nginx_keycloak_upstream_rt.conf
34
+ NGINX_KEYCLOAK_UPSTREAM_CONF=${NGINX_CONF_DIR} /nginx_keycloak_upstream.conf
35
+
32
36
# "include" file for auth_basic, prompt, and htpasswd location
33
37
NGINX_BASIC_AUTH_CONF=${NGINX_CONF_DIR} /nginx_auth_basic.conf
34
38
NGINX_AUTH_BASIC_LOCATION_CONF=${NGINX_CONF_DIR} /nginx_auth_basic_location.conf
35
39
40
+ # "include" file for htadmin upstream
41
+ NGINX_HTADMIN_UPSTREAM_LINK=${NGINX_CONF_DIR} /nginx_htadmin_upstream_rt.conf
42
+ NGINX_HTADMIN_UPSTREAM_CONF=${NGINX_CONF_DIR} /nginx_htadmin_upstream.conf
43
+
36
44
# "include" file for auth_ldap, prompt, and "auth_ldap_servers" name
37
45
NGINX_LDAP_AUTH_CONF=${NGINX_CONF_DIR} /nginx_auth_ldap.conf
38
46
@@ -50,6 +58,15 @@ NGINX_LDAP_USER_CONF=${NGINX_CONF_DIR}/nginx_ldap.conf
50
58
# runtime "include" file for auth method (link to NGINX_BASIC_AUTH_CONF, NGINX_LDAP_AUTH_CONF, NGINX_KEYCLOAK_AUTH_CONF, or NGINX_NO_AUTH_CONF)
51
59
NGINX_RUNTIME_AUTH_LINK=${NGINX_CONF_DIR} /nginx_auth_rt.conf
52
60
61
+ # "include" files and links for embedded opensearch, if used
62
+ NGINX_OPENSEARCH_UPSTREAM_LINK=${NGINX_CONF_DIR} /nginx_opensearch_upstream_rt.conf
63
+ NGINX_OPENSEARCH_UPSTREAM_CONF=${NGINX_CONF_DIR} /nginx_opensearch_upstream.conf
64
+ NGINX_OPENSEARCH_MAPI_LINK=${NGINX_CONF_DIR} /nginx_opensearch_mapi_rt.conf
65
+ NGINX_OPENSEARCH_MAPI_CONF=${NGINX_CONF_DIR} /nginx_opensearch_mapi.conf
66
+ NGINX_OPENSEARCH_API_LINK=${NGINX_CONF_DIR} /nginx_opensearch_api_rt.conf
67
+ NGINX_OPENSEARCH_API_CONF=${NGINX_CONF_DIR} /nginx_opensearch_api.conf
68
+ NGINX_OPENSEARCH_API_501_CONF=${NGINX_CONF_DIR} /nginx_opensearch_api_501.conf
69
+
53
70
# runtime "include" file for opensearch endpoint auth method (link to NGINX_BASIC_AUTH_CONF, NGINX_LDAP_AUTH_CONF, or NGINX_NO_AUTH_CONF)
54
71
NGINX_RUNTIME_AUTH_OPENSEARCH_LINK=${NGINX_CONF_DIR} /nginx_auth_opensearch_rt.conf
55
72
134
151
# set logging level for error.log
135
152
echo " error_log /var/log/nginx/error.log ${NGINX_ERROR_LOG_LEVEL:- error} ;" > " ${NGINX_LOGGING_CONF} "
136
153
154
+ # set up config links for whether there's an embedded opensearch instance or not
155
+ if [[ " ${OPENSEARCH_PRIMARY:- opensearch-local} " == " opensearch-local" ]]; then
156
+ ln -sf " $NGINX_OPENSEARCH_UPSTREAM_CONF " " $NGINX_OPENSEARCH_UPSTREAM_LINK "
157
+ ln -sf " $NGINX_OPENSEARCH_MAPI_CONF " " $NGINX_OPENSEARCH_MAPI_LINK "
158
+ ln -sf " $NGINX_OPENSEARCH_API_CONF " " $NGINX_OPENSEARCH_API_LINK "
159
+ else
160
+ ln -sf " $NGINX_BLANK_CONF " " $NGINX_OPENSEARCH_UPSTREAM_LINK "
161
+ ln -sf " $NGINX_BLANK_CONF " " $NGINX_OPENSEARCH_MAPI_LINK "
162
+ ln -sf " $NGINX_OPENSEARCH_API_501_CONF " " $NGINX_OPENSEARCH_API_LINK "
163
+ fi
164
+
137
165
# NGINX_AUTH_MODE basic|ldap|keycloak|keycloak_remote|no_authentication
138
166
if [[ -z $NGINX_AUTH_MODE ]] || [[ " $NGINX_AUTH_MODE " == " basic" ]] || [[ " $NGINX_AUTH_MODE " == " true" ]]; then
139
167
# doing HTTP basic auth
@@ -147,9 +175,11 @@ if [[ -z $NGINX_AUTH_MODE ]] || [[ "$NGINX_AUTH_MODE" == "basic" ]] || [[ "$NGIN
147
175
148
176
# /auth location handling for htpasswd
149
177
ln -sf " $NGINX_AUTH_BASIC_LOCATION_CONF " " $NGINX_AUTH_LOCATION_LINK "
178
+ ln -sf " $NGINX_HTADMIN_UPSTREAM_CONF " " $NGINX_HTADMIN_UPSTREAM_LINK "
150
179
151
180
# /keycloak location isn't used
152
181
ln -sf " $NGINX_BLANK_CONF " " $NGINX_KEYCLOAK_LOCATION_LINK "
182
+ ln -sf " $NGINX_BLANK_CONF " " $NGINX_KEYCLOAK_UPSTREAM_LINK "
153
183
154
184
elif [[ " $NGINX_AUTH_MODE " == " no_authentication" ]] || [[ " $NGINX_AUTH_MODE " == " none" ]] || [[ " $NGINX_AUTH_MODE " == " no" ]]; then
155
185
# completely disabling authentication (not recommended)
@@ -163,7 +193,9 @@ elif [[ "$NGINX_AUTH_MODE" == "no_authentication" ]] || [[ "$NGINX_AUTH_MODE" ==
163
193
164
194
# /auth and /keycloak locations are empty
165
195
ln -sf " $NGINX_BLANK_CONF " " $NGINX_AUTH_LOCATION_LINK "
196
+ ln -sf " $NGINX_BLANK_CONF " " $NGINX_HTADMIN_UPSTREAM_LINK "
166
197
ln -sf " $NGINX_BLANK_CONF " " $NGINX_KEYCLOAK_LOCATION_LINK "
198
+ ln -sf " $NGINX_BLANK_CONF " " $NGINX_KEYCLOAK_UPSTREAM_LINK "
167
199
168
200
elif [[ " $NGINX_AUTH_MODE " == " keycloak_remote" ]]; then
169
201
# Keycloak (remote) authentication
@@ -185,9 +217,11 @@ elif [[ "$NGINX_AUTH_MODE" == "keycloak_remote" ]]; then
185
217
186
218
# /auth location handling for htpasswd
187
219
ln -sf " $NGINX_AUTH_BASIC_LOCATION_CONF " " $NGINX_AUTH_LOCATION_LINK "
220
+ ln -sf " $NGINX_HTADMIN_UPSTREAM_CONF " " $NGINX_HTADMIN_UPSTREAM_LINK "
188
221
189
222
# /keycloak location isn't used
190
223
ln -sf " $NGINX_BLANK_CONF " " $NGINX_KEYCLOAK_LOCATION_LINK "
224
+ ln -sf " $NGINX_BLANK_CONF " " $NGINX_KEYCLOAK_UPSTREAM_LINK "
191
225
192
226
elif [[ " $NGINX_AUTH_MODE " == " keycloak" ]]; then
193
227
# Keycloak (embedded) authentication
@@ -209,9 +243,11 @@ elif [[ "$NGINX_AUTH_MODE" == "keycloak" ]]; then
209
243
210
244
# /auth location handling for htpasswd
211
245
ln -sf " $NGINX_AUTH_BASIC_LOCATION_CONF " " $NGINX_AUTH_LOCATION_LINK "
246
+ ln -sf " $NGINX_HTADMIN_UPSTREAM_CONF " " $NGINX_HTADMIN_UPSTREAM_LINK "
212
247
213
248
# /keycloak location points to embedded keycloak container
214
249
ln -sf " $NGINX_KEYCLOAK_LOCATION_CONF " " $NGINX_KEYCLOAK_LOCATION_LINK "
250
+ ln -sf " $NGINX_KEYCLOAK_UPSTREAM_CONF " " $NGINX_KEYCLOAK_UPSTREAM_LINK "
215
251
216
252
elif [[ " $NGINX_AUTH_MODE " == " ldap" ]] || [[ " $NGINX_AUTH_MODE " == " false" ]]; then
217
253
# ldap authentication
@@ -222,7 +258,9 @@ elif [[ "$NGINX_AUTH_MODE" == "ldap" ]] || [[ "$NGINX_AUTH_MODE" == "false" ]];
222
258
223
259
# /auth and /keycloak locations are empty
224
260
ln -sf " $NGINX_BLANK_CONF " " $NGINX_AUTH_LOCATION_LINK "
261
+ ln -sf " $NGINX_BLANK_CONF " " $NGINX_HTADMIN_UPSTREAM_LINK "
225
262
ln -sf " $NGINX_BLANK_CONF " " $NGINX_KEYCLOAK_LOCATION_LINK "
263
+ ln -sf " $NGINX_BLANK_CONF " " $NGINX_KEYCLOAK_UPSTREAM_LINK "
226
264
227
265
# parse URL information out of user ldap configuration
228
266
# example:
0 commit comments