- Add mod_ssl to support https reverse proxy,

- Add proto arg to Proxy_Ext, Proxy_Int & Proxy_Ext_Int macros (Warning: Interface break!),
- Now use rx3-docker/server:1.4.1-mga9 image (Rx3 CA support).
This commit is contained in:
AlkorZ3 committed 2026-10-31 19:10:05 +01:00
1 parent 97480f993b
commit 1ad3205db3
4 files changed
+52 -29

No files matched your search

+37 -26
View File
@@ -74,7 +74,7 @@ ARG HTTPD_CONF='#---------------------------------------------------------------
# prefix_int should be formated as: "", "aaa/" or "aaa/bbb/"... \n\
#------------------------------------------------------------------------------- \n\
\n\
<Macro _Proxy $prefix_ext $prefix_int $host $port> \n\
<Macro _Proxy $prefix_ext $prefix_int $proto $host $port> \n\
\n\
RewriteCond "`$prefix_ext`" "!= ``" \n\
RewriteRule "^/$prefix_ext$" "/$prefix_ext/" [R,L] \n\
@@ -82,8 +82,16 @@ ARG HTTPD_CONF='#---------------------------------------------------------------
<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\
ProxyPass $proto://$host:$port/$prefix_int flushpackets=on nocanon \n\
ProxyPassReverse $proto://$host:$port/$prefix_int \n\
\n\
# PreserveHost \n\
<If "`$proto` == `https`"> \n\
ProxyPreserveHost Off \n\
</If> \n\
<Else> \n\
ProxyPreserveHost On \n\
</Else> \n\
\n\
# CookiePath Mapping \n\
<If "`$prefix_int` != ``"> \n\
@@ -105,7 +113,7 @@ ARG HTTPD_CONF='#---------------------------------------------------------------
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\
Header edit* Location ^($proto://[^/]+)/(?!$prefix_ext/)(.*)$ $1/$prefix_ext/$2 \n\
\n\
# Fix relative Location headers (starting with /) \n\
Header edit* Location ^/(?!$prefix_ext/)(.*)$ /$prefix_ext/$1 \n\
@@ -121,16 +129,16 @@ ARG HTTPD_CONF='#---------------------------------------------------------------
# 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 Proxy_Ext $prefix_ext $proto $host $port> \n\
Use _Proxy $prefix_ext "" $proto $host $port \n\
</Macro> \n\
\n\
<Macro Proxy_Int $prefix_ext $prefix_int $host $port> \n\
Use _Proxy "" $prefix_int/ $host $port \n\
<Macro Proxy_Int $prefix_ext $prefix_int $proto $host $port> \n\
Use _Proxy "" $prefix_int/ $proto $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 Proxy_Ext_Int $prefix_ext $prefix_int $proto $host $port> \n\
Use _Proxy $prefix_ext $prefix_int/ $proto $host $port \n\
</Macro> \n\
\n\
\n\
@@ -139,10 +147,12 @@ RewriteEngine On
\n\
# Reverse Proxy Configuration \n\
ProxyRequests Off \n\
ProxyPreserveHost On \n\
AllowEncodedSlashes NoDecode \n\
\n\
\n\
# SSL Reverse Proxy Configuration \n\
SSLProxyEngine On \n\
SSLProxyVerify require \n\
SSLProxyCACertificateFile /etc/pki/tls/certs/ca-bundle.crt \n\
\n\
<Directory /var/www/html> \n\
Options Includes Indexes FollowSymLinks \n\
@@ -162,20 +172,21 @@ ARG INFO_PHP='<?php
RUN . /etc/profile.d/rx3.sh && isl --add ${IMG_URL} \
&& urpmi.update -a \
&& urpmi --force apache apache-mod_proxy apache-mod_proxy_html apache-mod_php php-cli php-pgsql php-mysqli php-pdo_pgsql php-pdo_mysql php-phpmailer pwauth \
&& sed -i -e "s%#LoadModule macro_module modules/mod_macro.so%LoadModule macro_module modules/mod_macro.so%" /etc/httpd/conf/modules.d/00_base.conf \
&& mv /etc/httpd/conf/sites.d/00_default_vhosts.conf /etc/httpd/conf/sites.d/00-default_vhost.conf \
&& sed -i -e "s%ServerName localhost%ServerName localhost\n\n Include conf/sites.d/default_vhost.d/*.conf%" /etc/httpd/conf/sites.d/00-default_vhost.conf \
&& mkdir /etc/httpd/conf/sites.d/default_vhost.d \
&& rm -f /var/log/README \
&& echo -e "${HTTPD}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/httpd \
&& chmod a+x /etc/init.d/httpd \
&& ln -s /etc/init.d/httpd /etc/rcD.d/S30httpd \
&& echo -e "${HTTPD_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/httpd.ini \
&& echo -e "${HTTPD_CONF}" | sed -e "s/\`/'/g" -e 's/ *$//' > ${HTTPD_CONF_FILE} \
&& echo -e "${INFO_PHP}" | sed -e "s/\`/'/g" -e 's/ *$//' > /var/www/html/info.php
RUN . /etc/profile.d/rx3.sh && isl --add ${IMG_URL} \
&& urpmi.update -a \
&& urpmi --force apache apache-mod_ssl apache-mod_proxy apache-mod_proxy_html apache-mod_php php-cli php-pgsql php-mysqli php-pdo_pgsql php-pdo_mysql php-phpmailer pwauth \
&& sed -i -e "s%#LoadModule macro_module modules/mod_macro.so%LoadModule macro_module modules/mod_macro.so%" /etc/httpd/conf/modules.d/00_base.conf \
&& sed -i -e "s%^Listen 443%#Listen 443%" /etc/httpd/conf/conf.d/ssl.conf \
&& mv /etc/httpd/conf/sites.d/00_default_vhosts.conf /etc/httpd/conf/sites.d/00-default_vhost.conf \
&& sed -i -e "s%ServerName localhost%ServerName localhost\n\n Include conf/sites.d/default_vhost.d/*.conf%" /etc/httpd/conf/sites.d/00-default_vhost.conf \
&& mkdir /etc/httpd/conf/sites.d/default_vhost.d \
&& rm -f /var/log/README \
&& echo -e "${HTTPD}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/init.d/httpd \
&& chmod a+x /etc/init.d/httpd \
&& ln -s /etc/init.d/httpd /etc/rcD.d/S30httpd \
&& echo -e "${HTTPD_INI}" | sed -e "s/\`/'/g" -e 's/ *$//' > /etc/supervisord.d/httpd.ini \
&& echo -e "${HTTPD_CONF}" | sed -e "s/\`/'/g" -e 's/ *$//' > ${HTTPD_CONF_FILE} \
&& echo -e "${INFO_PHP}" | sed -e "s/\`/'/g" -e 's/ *$//' > /var/www/html/info.php