- Replace SupervisorProxy macro with more generic macros: Proxy_Ext, Proxy_Int & Proxy_Ext_Int.

This commit is contained in:
2026-03-01 20:24:47 +01:00
parent 451a7e9664
commit 3459974e5c
4 changed files with 145 additions and 73 deletions

View File

@@ -24,7 +24,7 @@ ARG HTTPD_CONF_FILE=/etc/httpd/conf/sites.d/default_vhost.d/30-rx3.conf
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ARG HTTPD='#!/bin/bash \n\ ARG HTTPD='#!/bin/bash \n\
\n\ \n\
[[ "${APACHE_UID}" != "" ]] && usermod -u ${APACHE_UID} apache \n\ [[ "${APACHE_UID}" != "" ]] && usermod -u ${APACHE_UID} apache \n\
@@ -54,46 +54,110 @@ then
else \n\ else \n\
file_enable /etc/supervisord.d/httpd.ini TRUE \n\ file_enable /etc/supervisord.d/httpd.ini TRUE \n\
fi' fi'
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ARG HTTPD_INI='[program:httpd] \n\ ARG HTTPD_INI='[program:httpd] \n\
command=/usr/sbin/httpd -DFOREGROUND' command=/usr/sbin/httpd -DFOREGROUND'
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ARG HTTPD_CONF='<Macro SupervisorProxy $prefix $host $port> \n\ ARG HTTPD_CONF='#------------------------------------------------------------------------------- \n\
RewriteRule "^/$prefix$" "/$refix/" [R] \n\ # _Proxy (Internal Macro) \n\
#------------------------------------------------------------------------------- \n\
# Warning: prefix_ext should be formated as: "", "aaa" or "aaa/bbb"... \n\
# prefix_int should be formated as: "", "aaa/" or "aaa/bbb/"... \n\
#------------------------------------------------------------------------------- \n\
\n\ \n\
<Location /$prefix/> \n\ <Macro _Proxy $prefix_ext $prefix_int $host $port> \n\
ProxyPass http://$host:$port/ \n\
ProxyPassReverse http://$host:$port/ \n\
\n\ \n\
Header edit* Location ^(https?://[^/]+)/(?!$prefix/)(.*)$ $1/$prefix/index.html$2 \n\ RewriteCond "`$prefix_ext`" "!= ``" \n\
RewriteRule "^/$prefix_ext$" "/$prefix_ext/" [R,L] \n\
\n\
<Location /$prefix_ext/> \n\
Require all granted \n\
\n\
ProxyPass http://$host:$port/$prefix_int flushpackets=on nocanon \n\
ProxyPassReverse http://$host:$port/$prefix_int \n\
\n\
# CookiePath Mapping \n\
<If "`$prefix_int` != ``"> \n\
<If "`$prefix_ext` != ``"> \n\
ProxyPassReverseCookiePath /$prefix_int /$prefix_ext/ \n\
</If> \n\
<Else> \n\
ProxyPassReverseCookiePath /$prefix_int / \n\
</Else> \n\
</If> \n\
<ElseIf "`$prefix_ext` != ``"> \n\
ProxyPassReverseCookiePath / /$prefix_ext/ \n\
</ElseIf> \n\
\n\
# Header Normalization \n\
RequestHeader setifempty X-Forwarded-Proto expr=%{REQUEST_SCHEME} \n\
\n\
<If "`$prefix_ext` != ``"> \n\
RequestHeader setifempty X-Forwarded-Prefix "/$prefix_ext" \n\
\n\
# Fix absolute Location headers (with domain) \n\
Header edit* Location ^(https?://[^/]+)/(?!$prefix_ext/)(.*)$ $1/$prefix_ext/$2 \n\
\n\
# Fix relative Location headers (starting with /) \n\
Header edit* Location ^/(?!$prefix_ext/)(.*)$ /$prefix_ext/$1 \n\
</If> \n\
</Location> \n\ </Location> \n\
</Macro> \n\ </Macro> \n\
\n\ \n\
\n\
\n\
#------------------------------------------------------------------------------- \n\
# Proxy_Ext / Proxy_Int / Proxy_Ext_Int \n\
#------------------------------------------------------------------------------- \n\
# Warning: prefix_* should be formated as: "", "aaa" or "aaa/bbb"... \n\
#------------------------------------------------------------------------------- \n\
\n\
<Macro Proxy_Ext $prefix_ext $host $port> \n\
Use _Proxy $prefix_ext "" $host $port \n\
</Macro> \n\
\n\
<Macro Proxy_Int $prefix_ext $prefix_int $host $port> \n\
Use _Proxy "" $prefix_int/ $host $port \n\
</Macro> \n\
\n\
<Macro Proxy_Ext_Int $prefix_ext $prefix_int $host $port> \n\
Use _Proxy $prefix_ext $prefix_int/ $host $port \n\
</Macro> \n\
\n\
\n\
\n\
RewriteEngine On \n\ RewriteEngine On \n\
\n\ \n\
# Reverse Proxy Configuration \n\
ProxyRequests Off \n\
ProxyPreserveHost On \n\
AllowEncodedSlashes NoDecode \n\
\n\
\n\
\n\
<Directory /var/www/html> \n\ <Directory /var/www/html> \n\
Options Includes Indexes FollowSymLinks \n\ Options Includes Indexes FollowSymLinks \n\
AllowOverride All \n\ AllowOverride All \n\
Require all granted \n\ Require all granted \n\
</Directory>' </Directory>'
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ARG INFO_PHP='<?php \n\ ARG INFO_PHP='<?php \n\
phpinfo(); \n\ phpinfo(); \n\
phpinfo( INFO_MODULES); \n\ phpinfo( INFO_MODULES); \n\
?>' ?>'
#---------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@@ -5,14 +5,14 @@ Welcome to Rx3-Docker/PHP-Apache docker image!
This project aims to build a PHP + Apache docker image used by other Rx3 packaging projects. This project aims to build a PHP + Apache docker image used by other Rx3 packaging projects.
Features: Features:
- Curtently based on rx3-docker/server:1.2.7-mga9 image, - Curtently based on rx3-docker/server:1.3.0-mga9 image,
- default_vhost.d layout support, - default_vhost.d layout support,
- PostgreSQL & MySQL ready, - PostgreSQL & MySQL ready,
- PHPMailer installed, - PHPMailer installed,
- logrotate configured, - logrotate configured,
- Apache UID, GID & document root directory configurable, - Apache UID, GID & document root directory configurable,
- mod_proxy + mod_proxy_html installed, - mod_proxy + mod_proxy_html installed,
- SupervisorProxy Apache macro, - Proxy Apache macro,
- HTTPD service enabled by default (APACHE_HTTPD_ENABLED), - HTTPD service enabled by default (APACHE_HTTPD_ENABLED),
- PHP_MEMORY_LIMIT variable set to 512M by default, - PHP_MEMORY_LIMIT variable set to 512M by default,
- PHP_UPLOAD_LIMIT variable set to 32M by defaylt. - PHP_UPLOAD_LIMIT variable set to 32M by defaylt.

View File

@@ -1,3 +1,11 @@
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/PHP-Apache V 1.6.3 - A. GIBERT - 2026/03/01
------------------------------------------------------------------------------------------------------------------------------------
- Replace SupervisorProxy macro with more generic macros: Proxy_Ext, Proxy_Int & Proxy_Ext_Int.
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
Rx3-Docker/PHP-Apache V 1.6.2 - A. GIBERT - 2026/02/16 Rx3-Docker/PHP-Apache V 1.6.2 - A. GIBERT - 2026/02/16
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------

View File

@@ -38,7 +38,7 @@ DOCKER_TOOLS_EXEPTION_LIBS="httpd:/var/www/html"
# | Prefix | Name | URL Prefix | Name | Name Full | Version | URL Prefix | Name | Version | Name | Version | Ext | Int | Ext | Int | Name / Id | Name / Id | # | Prefix | Name | URL Prefix | Name | Name Full | Version | URL Prefix | Name | Version | Name | Version | Ext | Int | Ext | Int | Name / Id | Name / Id |
#------------------+----------+--------------------------+--------------------+------------------+-------------------------------+-----------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+ #------------------+----------+--------------------------+--------------------+------------------+-------------------------------+-----------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+
docker_service_add WA webapp ${ORG_URL_PREFIX} php-apache "Rx3-Docker/PHP-Apache" 1.6.2-mga9 ${ORG_URL_PREFIX} server 1.3.0-mga9 httpd - 8080 80 - - apache apache docker_service_add WA webapp ${ORG_URL_PREFIX} php-apache "Rx3-Docker/PHP-Apache" 1.6.3-mga9 ${ORG_URL_PREFIX} server 1.3.0-mga9 httpd - 8080 80 - - apache apache