Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions 32/apache/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ if expr "$1" : "apache" 1>/dev/null; then
if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then
a2disconf remoteip
fi
if [ -n "${APACHE_HTTP_PORT}" ]; then
sed -i "s/Listen 80/Listen $APACHE_HTTP_PORT/" /etc/apache2/ports.conf
fi
if [ -n "${APACHE_HTTPS_PORT}" ]; then
sed -i "s/Listen 443/Listen $APACHE_HTTPS_PORT/" /etc/apache2/ports.conf
fi
fi

if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
Expand Down
6 changes: 6 additions & 0 deletions 32/fpm-alpine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ if expr "$1" : "apache" 1>/dev/null; then
if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then
a2disconf remoteip
fi
if [ -n "${APACHE_HTTP_PORT}" ]; then
sed -i "s/Listen 80/Listen $APACHE_HTTP_PORT/" /etc/apache2/ports.conf
fi
if [ -n "${APACHE_HTTPS_PORT}" ]; then
sed -i "s/Listen 443/Listen $APACHE_HTTPS_PORT/" /etc/apache2/ports.conf
fi
fi

if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
Expand Down
6 changes: 6 additions & 0 deletions 32/fpm/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ if expr "$1" : "apache" 1>/dev/null; then
if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then
a2disconf remoteip
fi
if [ -n "${APACHE_HTTP_PORT}" ]; then
sed -i "s/Listen 80/Listen $APACHE_HTTP_PORT/" /etc/apache2/ports.conf
fi
if [ -n "${APACHE_HTTPS_PORT}" ]; then
sed -i "s/Listen 443/Listen $APACHE_HTTPS_PORT/" /etc/apache2/ports.conf
fi
fi

if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
Expand Down
6 changes: 6 additions & 0 deletions 33/apache/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ if expr "$1" : "apache" 1>/dev/null; then
if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then
a2disconf remoteip
fi
if [ -n "${APACHE_HTTP_PORT}" ]; then
sed -i "s/Listen 80/Listen $APACHE_HTTP_PORT/" /etc/apache2/ports.conf
fi
if [ -n "${APACHE_HTTPS_PORT}" ]; then
sed -i "s/Listen 443/Listen $APACHE_HTTPS_PORT/" /etc/apache2/ports.conf
fi
fi

if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
Expand Down
6 changes: 6 additions & 0 deletions 33/fpm-alpine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ if expr "$1" : "apache" 1>/dev/null; then
if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then
a2disconf remoteip
fi
if [ -n "${APACHE_HTTP_PORT}" ]; then
sed -i "s/Listen 80/Listen $APACHE_HTTP_PORT/" /etc/apache2/ports.conf
fi
if [ -n "${APACHE_HTTPS_PORT}" ]; then
sed -i "s/Listen 443/Listen $APACHE_HTTPS_PORT/" /etc/apache2/ports.conf
fi
fi

if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
Expand Down
6 changes: 6 additions & 0 deletions 33/fpm/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ if expr "$1" : "apache" 1>/dev/null; then
if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then
a2disconf remoteip
fi
if [ -n "${APACHE_HTTP_PORT}" ]; then
sed -i "s/Listen 80/Listen $APACHE_HTTP_PORT/" /etc/apache2/ports.conf
fi
if [ -n "${APACHE_HTTPS_PORT}" ]; then
sed -i "s/Listen 443/Listen $APACHE_HTTPS_PORT/" /etc/apache2/ports.conf
fi
fi

if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
Expand Down
6 changes: 6 additions & 0 deletions 34/apache/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ if expr "$1" : "apache" 1>/dev/null; then
if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then
a2disconf remoteip
fi
if [ -n "${APACHE_HTTP_PORT}" ]; then
sed -i "s/Listen 80/Listen $APACHE_HTTP_PORT/" /etc/apache2/ports.conf
fi
if [ -n "${APACHE_HTTPS_PORT}" ]; then
sed -i "s/Listen 443/Listen $APACHE_HTTPS_PORT/" /etc/apache2/ports.conf
fi
fi

if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
Expand Down
6 changes: 6 additions & 0 deletions 34/fpm-alpine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ if expr "$1" : "apache" 1>/dev/null; then
if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then
a2disconf remoteip
fi
if [ -n "${APACHE_HTTP_PORT}" ]; then
sed -i "s/Listen 80/Listen $APACHE_HTTP_PORT/" /etc/apache2/ports.conf
fi
if [ -n "${APACHE_HTTPS_PORT}" ]; then
sed -i "s/Listen 443/Listen $APACHE_HTTPS_PORT/" /etc/apache2/ports.conf
fi
fi

if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
Expand Down
6 changes: 6 additions & 0 deletions 34/fpm/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ if expr "$1" : "apache" 1>/dev/null; then
if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then
a2disconf remoteip
fi
if [ -n "${APACHE_HTTP_PORT}" ]; then
sed -i "s/Listen 80/Listen $APACHE_HTTP_PORT/" /etc/apache2/ports.conf
fi
if [ -n "${APACHE_HTTPS_PORT}" ]; then
sed -i "s/Listen 443/Listen $APACHE_HTTPS_PORT/" /etc/apache2/ports.conf
fi
fi

if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
Expand Down
6 changes: 6 additions & 0 deletions 35/apache/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ if expr "$1" : "apache" 1>/dev/null; then
if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then
a2disconf remoteip
fi
if [ -n "${APACHE_HTTP_PORT}" ]; then
sed -i "s/Listen 80/Listen $APACHE_HTTP_PORT/" /etc/apache2/ports.conf
fi
if [ -n "${APACHE_HTTPS_PORT}" ]; then
sed -i "s/Listen 443/Listen $APACHE_HTTPS_PORT/" /etc/apache2/ports.conf
fi
fi

if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
Expand Down
6 changes: 6 additions & 0 deletions 35/fpm-alpine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ if expr "$1" : "apache" 1>/dev/null; then
if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then
a2disconf remoteip
fi
if [ -n "${APACHE_HTTP_PORT}" ]; then
sed -i "s/Listen 80/Listen $APACHE_HTTP_PORT/" /etc/apache2/ports.conf
fi
if [ -n "${APACHE_HTTPS_PORT}" ]; then
sed -i "s/Listen 443/Listen $APACHE_HTTPS_PORT/" /etc/apache2/ports.conf
fi
fi

if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
Expand Down
6 changes: 6 additions & 0 deletions 35/fpm/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ if expr "$1" : "apache" 1>/dev/null; then
if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then
a2disconf remoteip
fi
if [ -n "${APACHE_HTTP_PORT}" ]; then
sed -i "s/Listen 80/Listen $APACHE_HTTP_PORT/" /etc/apache2/ports.conf
fi
if [ -n "${APACHE_HTTPS_PORT}" ]; then
sed -i "s/Listen 443/Listen $APACHE_HTTPS_PORT/" /etc/apache2/ports.conf
fi
fi

if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@ size of the HTTP request body sent from the client. It specifies the number of _

Check the [Nextcloud documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html#apache) for more information.

To change the default HTTP and HTTPS port from `80` and `443`, use the following variables:
- `APACHE_HTTP_PORT` (default 80): Set the http port of the proxy
- `APACHE_HTTPS_PORT` (default 443) Set the https port of the proxy

### Using the image behind a reverse proxy and specifying the server host and protocol

By default, the apache image will replace the remote addr (IP address visible to Nextcloud) with the IP address from `X-Real-IP` if the request is coming from a reverse proxy in `10.0.0.0/8`, `172.16.0.0/12` or `192.168.0.0/16`. If you want Nextcloud to pick up the server host (`HTTP_X_FORWARDED_HOST`), protocol (`HTTP_X_FORWARDED_PROTO`) and client IP (`HTTP_X_FORWARDED_FOR`) from a trusted proxy, then disable rewrite IP and add the reverse proxy's IP address to `TRUSTED_PROXIES`.
Expand Down
6 changes: 6 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ if expr "$1" : "apache" 1>/dev/null; then
if [ -n "${APACHE_DISABLE_REWRITE_IP+x}" ]; then
a2disconf remoteip
fi
if [ -n "${APACHE_HTTP_PORT}" ]; then
sed -i "s/Listen 80/Listen $APACHE_HTTP_PORT/" /etc/apache2/ports.conf
fi
if [ -n "${APACHE_HTTPS_PORT}" ]; then
sed -i "s/Listen 443/Listen $APACHE_HTTPS_PORT/" /etc/apache2/ports.conf
fi
fi

if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UPDATE:-0}" -eq 1 ]; then
Expand Down