Enable sshfs or ftp folder as nginx local paths
531
This is the docker project to setup nginx http server over sshfs or/and ftp remote folder.
docker run -it -p 80:80 --cap-add SYS_ADMIN --device=/dev/fuse -v ~/.ssh:/root/.ssh \
-e SSH_REMOTE_HOST=example.com -e SSH_REMOTE_PATH=/remote/path -e SSH_REMOTE_USER=example \
fengzhou/nginx-fuse
or specify private key file
docker run -it -p 80:80 --cap-add SYS_ADMIN --device=/dev/fuse -v ~/.ssh/id_rsa:/mnt/id_rsa \
-e SSH_REMOTE_HOST=example.com -e SSH_REMOTE_PATH=/remote/path -e SSH_REMOTE_USER=example -e SSH_REMOTE_KEY=/mnt/id_rsa \
fengzhou/nginx-fuse
docker run -it -p 80:80 --cap-add SYS_ADMIN --device=/dev/fuse \
-e SSH_REMOTE_HOST=example.com -e SSH_REMOTE_PATH=/remote/path -e SSH_REMOTE_USER=example \
fengzhou/nginx-fuse
The container will request password input in startup.
docker run -it -p 80:80 --cap-add SYS_ADMIN --device=/dev/fuse \
-e SSH_REMOTE_HOST=example.com -e SSH_REMOTE_PATH=/remote/path -e SSH_REMOTE_USER=example -e SSH_REMOTE_PASSWORD=password \
fengzhou/nginx-fuse
docker run -it -p 80:80 --cap-add SYS_ADMIN --device=/dev/fuse \
-e FTP_REMOTE_HOST=example.com -e FTP_REMOTE_PATH=/remote/path \
fengzhou/nginx-fuse
docker run -it -p 80:80 --cap-add SYS_ADMIN --device=/dev/fuse \
-e FTP_REMOTE_HOST=example.com -e FTP_REMOTE_PATH=/remote/path -e FTP_REMOTE_USER=example -e FTP_REMOTE_PASSWORD=password \
fengzhou/nginx-fuse
This image also supports multiple ssh/ftp remote folders. Combine different environments to support both.
The TYPE_i value is used to indicates remote type, and i is starting from 1. Currently, it supports ssh or ftp values.
For each remote, support following environment variables (replace _1 to other values for multiple folders):
For ssh type, the ssh key file can use following additional environment variable:
Refer to sample docker-compose.yml file, and configure relative environment variable, and ports.
Content type
Image
Digest
Size
52 MB
Last updated
over 8 years ago
docker pull fengzhou/nginx-fuse