@@ -65,6 +65,7 @@ for var in \
65
65
NPP_GID \
66
66
NPP_DEV_ENABLED \
67
67
NPP_HTTP_HOST \
68
+ NPP_HACK_HOST \
68
69
NPP_DEV_PLUGIN_NAME \
69
70
NPP_DEV_PLUGIN_DIR \
70
71
NPP_DEV_TMP_CLONE_DIR \
@@ -126,11 +127,11 @@ resolve_host() {
126
127
}
127
128
128
129
# To enable NPP Plugin Nginx Cache Preload action:
129
- # ############################################################################################################
130
- # The NPP WordPress plugin uses "wget" with "WP_SITEURL" from inside the WordPress container to Preload cache .
130
+ # ##################################################################################################################
131
+ # The NPP WordPress plugin uses "wget" with "WP_SITEURL" from inside the WordPress container to Preload Nginx Cache .
131
132
# This means that if "WP_SITEURL" is set to "localhost", wget will attempt to fetch URLs from
132
133
# the containers own loopback interface rather than reaching the Nginx server that handles
133
- # cache preload requests.
134
+ # Cache Preload requests.
134
135
#
135
136
# To handle that;
136
137
#
@@ -158,8 +159,8 @@ resolve_host() {
158
159
# 3. Recommended docker way, edit wordpress service in docker-compose.yml,
159
160
# extra_hosts:
160
161
# - "example.com:Nginx_LAN_IP"
161
- # ##############################################################################################################
162
- if [[ " ${NPP_DEV_ENABLED } " -eq 1 ]]; then
162
+ # ##################################################################################################################
163
+ if [[ " ${NPP_HACK_HOST } " -eq 1 ]]; then
163
164
# Create array
164
165
mapfile -t ip_array < <( resolve_host host.docker.internal)
165
166
@@ -179,7 +180,7 @@ if [[ "${NPP_DEV_ENABLED}" -eq 1 ]]; then
179
180
echo -e " ${COLOR_GREEN}${COLOR_BOLD} NPP-WP:${COLOR_RESET} ${COLOR_RED} Hacked!${COLOR_RESET} Mapped ${COLOR_LIGHT_CYAN}${NPP_HTTP_HOST}${COLOR_RESET} to host.docker.internal ${COLOR_LIGHT_CYAN}${ip_array[@]}${COLOR_RESET} in ${COLOR_LIGHT_CYAN}${HOSTS}${COLOR_RESET} ."
180
181
fi
181
182
fi
182
- # ###############################################################################################################
183
+ # ###################################################################################################################
183
184
184
185
# Check ownership of webroot for consistency
185
186
check_ownership () {
0 commit comments