HUB
Sign inSign up

comm/mirror

By comm

•Updated over 7 years ago

反向代理

Image
0

1.1K

comm/mirror repository overview

description:反向代理

⁠comm/mirror:nginx-proxy-manager

这个前台是如此的傻瓜以至于我根本配置不成功

fork自jlesage/nginx-proxy-manager

点击查看详细内容 Docker container for Nginx Proxy Manager

Docker Automated build Docker Image Build Status GitHub Release Donate

This is a Docker container for Nginx Proxy Manager.

Nginx Proxy Manager logoNginx Proxy Manager

Nginx Proxy Manager enables you to easily forward to your websites running at home or otherwise, including free SSL, without having to know too much about Nginx or Letsencrypt. Table of Content

Docker container for Nginx Proxy Manager
    Table of Content
    Quick Start
    Usage
        Environment Variables
        Data Volumes
        Ports
        Changing Parameters of a Running Container
    Docker Compose File
    Docker Image Update
        Synology
        unRAID
    User/Group IDs
    Accessing the GUI
    Shell Access
    Default Administrator Account
    Accessibility From The Internet
    Support or Contact

Quick Start

NOTE: The Docker command provided in this quick start is given as an example and parameters should be adjusted to your need.

Launch the Nginx Proxy Manager docker container with the following command:

docker run -d
--name=nginx-proxy-manager
-p 8181:8181
-p 8080:8080
-p 4443:4443
-v /docker/appdata/nginx-proxy-manager:/config:rw
jlesage/nginx-proxy-manager

Where:

/docker/appdata/nginx-proxy-manager: This is where the application stores its configuration, log and any files needing persistency.

Browse to http://your-host-ip:8181⁠ to access the Nginx Proxy Manager web interface. Usage

docker run [-d]
--name=nginx-proxy-manager
[-e <VARIABLE_NAME>=]...
[-v <HOST_DIR>:<CONTAINER_DIR>[:PERMISSIONS]]...
[-p <HOST_PORT>:<CONTAINER_PORT>]...
jlesage/nginx-proxy-manager

Parameter Description -d Run the container in background. If not set, the container runs in foreground. -e Pass an environment variable to the container. See the Environment Variables section for more details. -v Set a volume mapping (allows to share a folder/file between the host and the container). See the Data Volumes section for more details. -p Set a network port mapping (exposes an internal container port to the host). See the Ports section for more details. Environment Variables

To customize some properties of the container, the following environment variables can be passed via the -e parameter (one for each variable). Value of this parameter has the format <VARIABLE_NAME>=. Variable Description Default USER_ID ID of the user the application runs as. See User/Group IDs to better understand when this should be set. 1000 GROUP_ID ID of the group the application runs as. See User/Group IDs to better understand when this should be set. 1000 SUP_GROUP_IDS Comma-separated list of supplementary group IDs of the application. (unset) UMASK Mask that controls how file permissions are set for newly created files. The value of the mask is in octal notation. By default, this variable is not set and the default umask of 022 is used, meaning that newly created files are readable by everyone, but only writable by the owner. See the following online umask calculator: http://wintelguy.com/umask-calc.pl⁠ (unset) TZ TimeZone of the container. Timezone can also be set by mapping /etc/localtime between the host and the container. Etc/UTC KEEP_APP_RUNNING When set to 1, the application will be automatically restarted if it crashes or if user quits it. 0 APP_NICENESS Priority at which the application should run. A niceness value of -20 is the highest priority and 19 is the lowest priority. By default, niceness is not set, meaning that the default niceness of 0 is used. NOTE: A negative niceness (priority increase) requires additional permissions. In this case, the container should be run with the docker option --cap-add=SYS_NICE. (unset) CLEAN_TMP_DIR When set to 1, all files in the /tmp directory are delete during the container startup. 1 Data Volumes

The following table describes data volumes used by the container. The mappings are set via the -v parameter. Each mapping is specified with the following format: <HOST_DIR>:<CONTAINER_DIR>[:PERMISSIONS]. Container path Permissions Description /config rw This is where the application stores its configuration, log and any files needing persistency. Ports

Here is the list of ports used by the container. They can be mapped to the host via the -p parameter (one per port mapping). Each mapping is defined in the following format: <HOST_PORT>:<CONTAINER_PORT>. The port number inside the container cannot be changed, but you are free to use any port on the host side. Port Mapping to host Description 8181 Mandatory Port used to access the web interface of the application. 8080 Mandatory Port used to serve HTTP requests. 4443 Mandatory Port used to serve HTTPs requests. Changing Parameters of a Running Container

As seen, environment variables, volume mappings and port mappings are specified while creating the container.

The following steps describe the method used to add, remove or update parameter(s) of an existing container. The generic idea is to destroy and re-create the container:

Stop the container (if it is running):

docker stop nginx-proxy-manager

Remove the container:

docker rm nginx-proxy-manager

Create/start the container using the docker run command, by adjusting parameters as needed.

NOTE: Since all application's data is saved under the /config container folder, destroying and re-creating a container is not a problem: nothing is lost and the application comes back with the same state (as long as the mapping of the /config folder remains the same). Docker Compose File

Here is an example of a docker-compose.yml file that can be used with Docker Compose.

Make sure to adjust according to your needs. Note that only mandatory network ports are part of the example.

version: '3' services: nginx-proxy-manager: build: . ports: - "8181:8181" - "8080:8080" - "4443:4443" volumes: - "/docker/appdata/nginx-proxy-manager:/config:rw"

Docker Image Update

If the system on which the container runs doesn't provide a way to easily update the Docker image, the following steps can be followed:

Fetch the latest image:

docker pull jlesage/nginx-proxy-manager

Stop the container:

docker stop nginx-proxy-manager

Remove the container:

docker rm nginx-proxy-manager

Start the container using the docker run command.

Synology

For owners of a Synology NAS, the following steps can be use to update a container image.

Open the Docker application.
Click on Registry in the left pane.
In the search bar, type the name of the container (jlesage/nginx-proxy-manager).
Select the image, click Download and then choose the latest tag.
Wait for the download to complete. A notification will appear once done.
Click on Container in the left pane.
Select your Nginx Proxy Manager container.
Stop it by clicking Action->Stop.
Clear the container by clicking Action->Clear. This removes the container while keeping its configuration.
Start the container again by clicking Action->Start. NOTE: The container may temporarily disappear from the list while it is re-created.

unRAID

For unRAID, a container image can be updated by following these steps:

Select the Docker tab.
Click the Check for Updates button at the bottom of the page.
Click the update ready link of the container to be updated.

User/Group IDs

When using data volumes (-v flags), permissions issues can occur between the host and the container. For example, the user within the container may not exists on the host. This could prevent the host from properly accessing files and folders on the shared volume.

To avoid any problem, you can specify the user the application should run as.

This is done by passing the user ID and group ID to the container via the USER_ID and GROUP_ID environment variables.

To find the right IDs to use, issue the following command on the host, with the user owning the data volume on the host:

id

Which gives an output like this one:

uid=1000(myuser) gid=1000(myuser) groups=1000(myuser),4(adm),24(cdrom),27(sudo),46(plugdev),113(lpadmin)

The value of uid (user ID) and gid (group ID) are the ones that you should be given the container. Accessing the GUI

Assuming that container's ports are mapped to the same host's ports, the interface of the application can be accessed with a web browser at:

http://:8181

Shell Access

To get shell access to a the running container, execute the following command:

docker exec -ti CONTAINER sh

Where CONTAINER is the ID or the name of the container used during its creation (e.g. crashplan-pro). Default Administrator Account

After a fresh install, use the following credentials to login:

Email address: [email protected]
Password: changeme

After you login with this default user, you will be asked to modify your details and change your password. Accessibility From The Internet

NOTE: This section assumes that the container is using the default bridge network type.

For this container to be accessible from the Internet, port forwarding must be configured on your router. This allows HTTP (port 80) and HTTPs (port 443) traffic from the Internet to reach this container on your private network.

Configuration of port forwarding differs from one router to another, but in general the same information must be configured:

External port: The Internet-side port to be forwarded.
Internal port: The port to forward to. Also called private port.
Destination IP address: The IP address of the device on the local network to forward to. Also called private IP address.

The IP address to forward to should be the IP address of the host running the container. The port to forward to should be the port mapped to the container during its creation (via the -p parameter of the docker run command).

Since the container needs to handle both HTTP and HTTPs traffic, two ports need to be forwarded: Traffic type Container port Host port mapped to container External port Internal port Internal IP address HTTP 8080 XXXX 80 XXXX IP address of the host running the container. HTTPs 4443 YYYY 443 YYYY IP address of the host running the container.

XXXX and YYYY are configurable port values. Unless they conflict with other used ports on the host, they can simply be set to the same value as the container port.

NOTE: Some routers don't offer the ability to configure the internal port to forward to. This means that internal port is the same as the external one. In a such scenario, XXXX must be set to 80 and YYYY to 443.

For more details about port forwarding, see the following links:

How to Port Forward - General Guide to Multiple Router Brands
How to Forward Ports on Your Router

Support or Contact

Having troubles with the container or have questions? Please create a new issue.

For other great Dockerized applications, see https://jlesage.github.io/docker-apps⁠.



⁠comm/mirror:apache

docker run -d --restart always -p 8089:80 -e "URL=https://www.XXX.com/v" comm/mirror:apache

fork自robertdebock/mirror

点击查看详细内容 Mirror any website

Build Status

With this application you can mirror any IP or URL to an existing website. This may be useful to:

Hook a personal domain to some service like Flickr, Wordpress, The Pirate Bay or Tumblr.
Allow visitors to see a website banned through regular channels.

Overview

+-----------------+ +------------------+ +------------------+ | Your computer | -> | This application | -> | Existing website | | or The internet | | Docker container | | https://bla.com/⁠ | +-----------------+ +------------------+ +------------------+

TL;DR

For websites without a path:

docker run -p 8443:443 -e "URL=https://thepiratebay.org/⁠" robertdebock/mirror

Nota bene: the URL ends with a /.

For websites with a path:

docker run -p 8443:443 -e "URL=https://www.flickr.com/photos/robertdebock⁠" robertdebock/mirror

Nota bene: the URL does not end with a /. Mandatory parameters

-p 8443:443 - Map host (external) TCP port to the container. In this case TCP port 8443 can be accessed by visitors and it's mapped to TP port 443 inside the container. Port 80 is also available in the container, serving the same content.
-e "URL=https://www.flickr.com/photos/robertdebock" - Setup the (Apache) proxy to map a custom URL to https://www.flickr.com/photos/robertdebock. It's best to (try to) open the website in a browser, let all redirects take place and use the final URL. In case you'd like to mirror the homepage, ensure you end the URL with a / . Like so https://bla.com/

Optional parameters

-v $(pwd)/data:/data - Map the volume "./data" to /data. This is the place where keys and certificates are expected, with this exact naming: server.key for the SSL Key, server.crt for the SSL Certificate.
-e "DOMAIN=example.com" - Set the common name to "example.com". Used for the SSL Certificate and the Apache ServerName.
--dns 8.8.8.8 - Set the DNS to 8.8.8.8 (Googles DNS). Use this to overcome DNS-blocked websites.

Where stuff is

The code is on GitHub - mirror.
Testing is done on Travis CI - mirror.
The Docker image is available Docker Hub - mirror.


⁠comm/mirror:nginx

fork自bitnami/nginx:1.9.15-1

点击查看详细内容 What is NGINX Open Source?
NGINX (pronounced "engine-x") is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3 and IMAP protocols, as well as a load balancer, HTTP cache, and a web server (origin server).

http://nginx.org/⁠ TL;DR;

$ docker run --name nginx bitnami/nginx:latest

Docker Compose

$ curl -sSL https://raw.githubusercontent.com/bitnami/bitnami-docker-nginx/master/docker-compose.yml⁠ > docker-compose.yml $ docker-compose up -d

Why use Bitnami Images?

Bitnami closely tracks upstream source changes and promptly publishes new versions of this image using our automated systems.
With Bitnami images the latest bug fixes and features are available as soon as possible.
Bitnami containers, virtual machines and cloud images use the same components and configuration approach - making it easy to switch between formats based on your project needs.
All our images are based on minideb a minimalist Debian based container image which gives you a small base container image and the familiarity of a leading linux distribution.
Bitnami container images are released daily with the latest distribution packages available.

This CVE scan report contains a security report with all open CVEs. To get the list of actionable security issues, find the "latest" tag, click the vulnerability report link under the corresponding "Security scan" field and then select the "Only show fixable" filter on the next page.

How to deploy NGINX Open Source in Kubernetes?

Deploying Bitnami applications as Helm Charts is the easiest way to get started with our applications on Kubernetes. Read more about the installation in the Bitnami NGINX Open Source Chart GitHub repository.

Bitnami containers can be used with Kubeapps for deployment and management of Helm Charts in clusters. Why use a non-root container?

Non-root container images add an extra layer of security and are generally recommended for production environments. However, because they run as a non-root user, privileged tasks are typically off-limits. Learn more about non-root containers in our docs. Supported tags and respective Dockerfile links

NOTE: Debian 8 images have been deprecated in favor of Debian 9 images. Bitnami will not longer publish new Docker images based on Debian 8. NOTE: RHEL images are not available in any public registry. You can build them on your side on top of RHEL as described on this doc.

Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags in our documentation page.

1.14-rhel-7, 1.14.2-rhel-7-r41 (1.14/rhel-7/Dockerfile)
1.14-ol-7, 1.14.2-ol-7-r91 (1.14/ol-7/Dockerfile)
1.14-debian-9, 1.14.2-debian-9-r83, 1.14, 1.14.2, 1.14.2-r83, latest (1.14/debian-9/Dockerfile)

Get this image

The recommended way to get the Bitnami NGINX Open Source Docker Image is to pull the prebuilt image from the Docker Hub Registry.

$ docker pull bitnami/nginx:latest

To use a specific version, you can pull a versioned tag. You can view the list of available versions in the Docker Hub Registry.

$ docker pull bitnami/nginx:[TAG]

If you wish, you can also build the image yourself.

$ docker build -t bitnami/nginx:latest https://github.com/bitnami/bitnami-docker-nginx.git⁠

Hosting a static website

This NGINX Open Source image exposes a volume at /app. Content mounted here is served by the default catch-all virtual host.

$ docker run -v /path/to/app:/app bitnami/nginx:latest

or using Docker Compose:

version: '2'

services: nginx: image: 'bitnami/nginx:latest' ports: - '80:8080' volumes: - /path/to/app:/app

Accessing your server from the host

To access your web server from your host machine you can ask Docker to map a random port on your host to ports 8080 and 8443 exposed in the container.

$ docker run --name nginx -P bitnami/nginx:latest

Run docker port to determine the random ports Docker assigned.

$ docker port nginx 8080/tcp -> 0.0.0.0:32769

You can also manually specify the ports you want forwarded from your host to the container.

$ docker run -p 9000:8080 bitnami/nginx:latest

Access your web server in the browser by navigating to http://localhost:9000⁠. Configuration Adding custom virtual hosts

The default nginx.conf includes virtual hosts placed in /bitnami/nginx/conf/vhosts/. You can mount a my_vhost.conf file containing your custom virtual hosts at this location.

For example, in order add a vhost for www.example.com⁠: Step 1: Write your my_vhost.conf file with the following content.

server { listen 0.0.0.0:8080; server_name www.example.com⁠; root /app; index index.htm index.html; }

Step 2: Mount the configuration as a volume.

$ docker run --name nginx
-v /path/to/my_vhost.conf:/opt/bitnami/nginx/conf/vhosts/my_vhost.conf:ro
bitnami/nginx:latest

or using Docker Compose:

version: '2'

services: nginx: image: 'bitnami/nginx:latest' ports: - '80:8080' volumes: - /path/to/my_vhost.conf:/opt/bitnami/nginx/conf/vhosts/my_vhost.conf:ro

Using custom SSL certificates

NOTE: The steps below assume that you are using a custom domain name and that you have already configured the custom domain name to point to your server. Step 1: Prepare your certificate files

In your local computer, create a folder called certs and put your certificates files. Make sure you rename both files to server.crt and server.key respectively:

$ mkdir /path/to/nginx-persistence/nginx/conf/bitnami/certs -p $ cp /path/to/certfile.crt /path/to/nginx-persistence/nginx/conf/bitnami/certs/server.crt $ cp /path/to/keyfile.key /path/to/nginx-persistence/nginx/conf/bitnami/certs/server.key

Step 2: Provide a custom Virtual Host for SSL connections

Write your my_vhost.conf file with the SSL configuration and the relative path to the certificates.

server { listen 8443 ssl;

ssl_certificate      bitnami/certs/server.crt;
ssl_certificate_key  bitnami/certs/server.key;

ssl_session_cache    shared:SSL:1m;
ssl_session_timeout  5m;

ssl_ciphers  HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers  on;

location / {
  root   html;
  index  index.html index.htm;
}

}

Step 3: Run the NGINX Open Source image and open the SSL port

Run the NGINX Open Source image, mounting the certificates directory from your host.

$ docker run --name nginx
-v /path/to/my_vhost.conf:/opt/bitnami/nginx/conf/vhosts/my_vhost.conf:ro
-v /path/to/nginx-persistence/nginx/conf/bitnami/certs:/bitnami/nginx/conf/bitnami/certs
bitnami/nginx:latest

or using Docker Compose:

version: '2'

services: nginx: image: 'bitnami/nginx:latest' ports: - '80:8080' - '443:8443' volumes: - /path/to/nginx-persistence/nginx/conf/bitnami/certs:/bitnami/nginx/conf/bitnami/certs

Full configuration

The image looks for configurations in /opt/bitnami/nginx/conf/nginx.conf. You can overwrite the nginx.conf file using your own custom configuration file.

$ docker run --name nginx
-v /path/to/your_nginx.conf:/opt/bitnami/nginx/conf/nginx.conf
bitnami/nginx:latest

or using Docker Compose:

version: '2'

services: nginx: image: 'bitnami/nginx:latest' ports: - '80:8080' volumes: - /path/to/your_nginx.conf:/opt/bitnami/nginx/conf/nginx.conf

Reverse proxy to other containers

NGINX can be used to reverse proxy to other containers using Docker's linking system. This is particularly useful if you want to serve dynamic content through an NGINX frontend. Bitnami provides example virtual hosts for all of our runtime containers in /opt/bitnami/nginx/conf/vhosts/.

Further Reading:

NGINX reverse proxy

Logging

The Bitnami NGINX Open Source Docker image sends the container logs to the stdout. To view the logs:

$ docker logs nginx

or using Docker Compose:

$ docker-compose logs nginx

You can configure the containers logging driver using the --log-driver option if you wish to consume the container logs differently. In the default configuration docker uses the json-file driver. Maintenance Upgrade this image

Bitnami provides up-to-date versions of NGINX Open Source, including security patches, soon after they are made upstream. We recommend that you follow these steps to upgrade your container. Step 1: Get the updated image

$ docker pull bitnami/nginx:latest

or if you're using Docker Compose, update the value of the image property to bitnami/nginx:latest. Step 2: Stop and backup the currently running container

Stop the currently running container using the command

$ docker stop nginx

or using Docker Compose:

$ docker-compose stop nginx

Step 3: Remove the currently running container

$ docker rm -v nginx

or using Docker Compose:

$ docker-compose rm -v nginx

Step 4: Run the new image

Re-create your container from the new image.

$ docker run --name nginx bitnami/nginx:latest

or using Docker Compose:

$ docker-compose up nginx

Useful Links

Create An EMP Development Environment With Bitnami Containers

Contributing

We'd love for you to contribute to this container. You can request new features by creating an issue, or submit a pull request with your contribution. Issues

If you encountered a problem running this container, you can file an issue. For us to provide better support, be sure to include the following information in your issue:

Host OS and version
Docker version (docker version)
Output of docker info
Version of this container (echo $BITNAMI_IMAGE_VERSION inside the container)
The command you used to run the container, and any relevant output you saw (masking any sensitive information)

License

Copyright (c) 2015-2019 Bitnami

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0⁠

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

反向代理及密码保护:

#proxy_redirect off
proxy_pass  http://192.168.100.103:8080/;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header host $host:$server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#auth_basic "Please input password";
#auth_basic_user_file  /opt/bitnami/nginx/conf/bitnami/passwd;

密码生成:

yum install -y httpd-tools
htpasswd -c /path/passwd comm

Tag summary

Content type

Image

Digest

Size

92.4 MB

Last updated

over 7 years ago

docker pull comm/mirror:nginx-proxy-manager