allowing proxying using .htaccess (1)

This commit is contained in:
Ludwig Lehnert
2026-04-12 16:12:04 +02:00
parent 48ff3bb121
commit f1c23fd133

View File

@@ -8,18 +8,11 @@ RUN sed -i \
-e 's/^#LoadModule alias_module/LoadModule alias_module/' \ -e 's/^#LoadModule alias_module/LoadModule alias_module/' \
-e 's/^#LoadModule proxy_module/LoadModule proxy_module/' \ -e 's/^#LoadModule proxy_module/LoadModule proxy_module/' \
-e 's/^#LoadModule proxy_http_module/LoadModule proxy_http_module/' \ -e 's/^#LoadModule proxy_http_module/LoadModule proxy_http_module/' \
-e 's/^#LoadModule ssl_module/LoadModule ssl_module/' \
/usr/local/apache2/conf/httpd.conf /usr/local/apache2/conf/httpd.conf
# Add proxy permissions + your config # Configure autoindex + icons + .htaccess + unrestricted reverse-proxy permissions
RUN printf '\n# --- Proxy config (required for [P] in .htaccess) ---\n\ RUN printf '\n# --- Custom for file listing + .htaccess ---\n\
ProxyRequests Off\n\
ProxyVia Off\n\
\n\
<Proxy "*">\n\
Require all granted\n\
</Proxy>\n\
\n\
# --- Custom for file listing + .htaccess ---\n\
AddDefaultCharset UTF-8\n\ AddDefaultCharset UTF-8\n\
\n\ \n\
Include conf/extra/httpd-autoindex.conf\n\ Include conf/extra/httpd-autoindex.conf\n\
@@ -29,6 +22,7 @@ Alias /icons/ "/usr/local/apache2/icons/"\n\
Require all granted\n\ Require all granted\n\
</Directory>\n\ </Directory>\n\
\n\ \n\
# Autoindex settings\n\
IndexOptions FancyIndexing FoldersFirst NameWidth=*\n\ IndexOptions FancyIndexing FoldersFirst NameWidth=*\n\
\n\ \n\
<Directory "/usr/local/apache2/htdocs">\n\ <Directory "/usr/local/apache2/htdocs">\n\
@@ -36,9 +30,14 @@ IndexOptions FancyIndexing FoldersFirst NameWidth=*\n\
IndexIgnore _*\n\ IndexIgnore _*\n\
AllowOverride All\n\ AllowOverride All\n\
Require all granted\n\ Require all granted\n\
</Directory>\n' >> /usr/local/apache2/conf/httpd.conf </Directory>\n\
\n\
# Optional: allow outbound proxy to HTTPS properly # Allow RewriteRule [P] from trusted .htaccess files\n\
RUN printf '\nSSLProxyEngine on\n' >> /usr/local/apache2/conf/httpd.conf ProxyRequests Off\n\
ProxyVia Off\n\
SSLProxyEngine on\n\
<Proxy "*">\n\
Require all granted\n\
</Proxy>\n' >> /usr/local/apache2/conf/httpd.conf
EXPOSE 80 EXPOSE 80