@@ -126,8 +126,8 @@ if [ -n "$PHP_MAX_EXECUTION_TIME" ]; then
126126 echo " max_execution_time = ${PHP_MAX_EXECUTION_TIME} " >> /usr/local/etc/php/conf.d/${PHP_INI_FILE_NAME}
127127fi
128128
129- # Status/Ping
130- if [ -f " /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini " -a " $PHP_SET_OPCACHE_SETTINGS " -eq " 1" ]; then
129+ # OPCACHE Settings
130+ if [ " $PHP_SET_OPCACHE_SETTINGS " -eq " 1" ]; then
131131 echo " >> set opcache settings"
132132 cat > /usr/local/etc/php/conf.d/55-opcache.ini << 'EOF '
133133; https://www.php.net/manual/en/opcache.configuration.php
151151# Status/Ping
152152if [ " $PHP_FPM_IS_EXISTS " -eq " 1" -a " $ENABLE_PHP_FPM_STATUS " -eq " 1" ]; then
153153 echo " >> enabling php-fpm status!"
154-
155154 cat > ${PHP_FPM_CONF_DIR_PATH} /y-status.conf << EOF
156155[www]
157156; status page (example: http://localhost:${PHP_FPM_STATUS_PORT}${PHP_FPM_STATUS_PATH} ?json&full)
@@ -316,7 +315,7 @@ if [ "$APACHE_IS_EXISTS" -eq "1" -a "$ENABLE_APACHE_STATUS" -eq "1" ]; then
316315 Require ip 10.0.0.0/8
317316 Require ip 172.16.0.0/12
318317 Require ip 192.168.0.0/16
319- # Require ip fd00::/7
318+ Require ip fd00::/8
320319 </Location>
321320</IfModule>
322321
@@ -401,7 +400,7 @@ r /dev/stdin
401400d
402401}' " ${NGINX_CONF_FILE} " << EOF
403402 # nginx status
404- location /nginx_status {
403+ location = /nginx_status {
405404 stub_status on;
406405 access_log off;
407406 allow 127.0.0.1;
414413 }
415414
416415 # nginx ping
417- location /nginx_ping {
416+ location = /nginx_ping {
418417 add_header Content-Type text/plain;
419418 return 200 'pong';
420419 access_log off;
457456if [ " $NGINX_IS_EXISTS " -eq " 1" -a " $ENABLE_NGINX_REMOTEIP " -eq " 1" ]; then
458457 # https://nginx.org/en/docs/http/ngx_http_realip_module.html
459458 echo " >> enabling remoteip support, use this only behind a proxy!"
460- nginx_remoteip_string=" set_real_ip_from 172.16.0.0/12;\n set_real_ip_from fd00::/8;\n ##REPLACE_WITH_MORE_REAL_IP##\n real_ip_header X-Forwarded-For;\n #real_ip_recursive on;\n"
461- sed -i " s|##REPLACE_WITH_REMOTEIP_CONFIG##|${nginx_remoteip_string} |g" ${NGINX_CONF_FILE}
459+ sed -i ' /##REPLACE_WITH_REMOTEIP_CONFIG##/{
460+ r /dev/stdin
461+ d
462+ }' " ${NGINX_CONF_FILE} " << 'EOF '
463+ # enable ONLY behind PROXY (Traefik, other NGINX, Caddy, lighttpd, K8s Ingress, ...) (ngx_http_realip_module)
464+ set_real_ip_from 172.16.0.0/12
465+ set_real_ip_from fd00::/8;
466+ ##REPLACE_WITH_MORE_REAL_IP##
467+ real_ip_header X-Forwarded-For;
468+ #real_ip_recursive on;
469+ EOF
462470fi
463471
464472# ###################################################
0 commit comments