allowing proxying using .htaccess
This commit is contained in:
@@ -1,15 +1,25 @@
|
||||
FROM httpd:2.4
|
||||
|
||||
# Enable modules
|
||||
# Enable required modules
|
||||
RUN sed -i \
|
||||
-e 's/^#LoadModule rewrite_module/LoadModule rewrite_module/' \
|
||||
-e 's/^#LoadModule headers_module/LoadModule headers_module/' \
|
||||
-e 's/^#LoadModule autoindex_module/LoadModule autoindex_module/' \
|
||||
-e 's/^#LoadModule alias_module/LoadModule alias_module/' \
|
||||
-e 's/^#LoadModule proxy_module/LoadModule proxy_module/' \
|
||||
-e 's/^#LoadModule proxy_http_module/LoadModule proxy_http_module/' \
|
||||
/usr/local/apache2/conf/httpd.conf
|
||||
|
||||
# Configure autoindex + icons + .htaccess + ignore "_" entries + UTF-8
|
||||
RUN printf '\n# --- Custom for file listing + .htaccess ---\n\
|
||||
# Add proxy permissions + your config
|
||||
RUN printf '\n# --- Proxy config (required for [P] in .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\
|
||||
\n\
|
||||
Include conf/extra/httpd-autoindex.conf\n\
|
||||
@@ -19,7 +29,6 @@ Alias /icons/ "/usr/local/apache2/icons/"\n\
|
||||
Require all granted\n\
|
||||
</Directory>\n\
|
||||
\n\
|
||||
# Autoindex settings\n\
|
||||
IndexOptions FancyIndexing FoldersFirst NameWidth=*\n\
|
||||
\n\
|
||||
<Directory "/usr/local/apache2/htdocs">\n\
|
||||
@@ -29,16 +38,7 @@ IndexOptions FancyIndexing FoldersFirst NameWidth=*\n\
|
||||
Require all granted\n\
|
||||
</Directory>\n' >> /usr/local/apache2/conf/httpd.conf
|
||||
|
||||
# Force download for shared files
|
||||
RUN printf '\n# --- Force download in _share ---\n\
|
||||
<Directory "/usr/local/apache2/htdocs/_share">\n\
|
||||
# Header set Content-Disposition "attachment"\n\
|
||||
# We want to let the application handle the download name if possible\n\
|
||||
# or just serve it directly if accessed directly. \n\
|
||||
# Actually, we should probably proxy requests for metadata resolution\n\
|
||||
# But for now, let''s just keep it simple. \n\
|
||||
# If we want Apache to serve it with original name, we need a map.\n\
|
||||
# Since we moved logic to Node, Apache just serves raw files if needed.\n\
|
||||
</Directory>\n' >> /usr/local/apache2/conf/httpd.conf
|
||||
# Optional: allow outbound proxy to HTTPS properly
|
||||
RUN printf '\nSSLProxyEngine on\n' >> /usr/local/apache2/conf/httpd.conf
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
Reference in New Issue
Block a user