From 0460a62956e6a397ef9cd2c9deb1083dc072cad1 Mon Sep 17 00:00:00 2001 From: butomo1989 Date: Fri, 26 Jun 2020 16:01:12 +0200 Subject: [PATCH 1/3] Added example of using nginx --- README_CUSTOM_CONFIG.md | 5 +++++ nginx/default | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100755 nginx/default diff --git a/README_CUSTOM_CONFIG.md b/README_CUSTOM_CONFIG.md index 4889dd1..deca136 100644 --- a/README_CUSTOM_CONFIG.md +++ b/README_CUSTOM_CONFIG.md @@ -77,3 +77,8 @@ docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 - ``` For the first run, this will create a new avd and all the changes will be accessible in the `local_backup` directory. Now for all future runs, it will reuse the avds. Even this should work with new releases of `docker-android` + +Nginx +----- + +You can have 1 nginx service to handle multiple containers. Sample nginx configuration is [this](nginx/default) and sample call is ```http://127.0.0.1/container-1/?nginx=&path=/container-1/websockify&view_only=true``` diff --git a/nginx/default b/nginx/default new file mode 100755 index 0000000..43eed04 --- /dev/null +++ b/nginx/default @@ -0,0 +1,25 @@ +server { + listen 80; + server_name _; + + location /container-1/ { + proxy_pass http://127.0.0.1:6080/; + } + + location /container-1/websockify { + proxy_pass http://127.0.0.1:6080/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + # VNC connection timeout + proxy_read_timeout 61s; + + # Disable cache + proxy_buffering off; + } + + location /emu2/ { + proxy_pass http://127.0.0.1:6081/; + } +} From 5936037a568794988b22d9ee6f506a37d7104225 Mon Sep 17 00:00:00 2001 From: butomo1989 Date: Fri, 26 Jun 2020 16:02:58 +0200 Subject: [PATCH 2/3] Removed unused lines --- nginx/default | 4 ---- 1 file changed, 4 deletions(-) diff --git a/nginx/default b/nginx/default index 43eed04..0b5deef 100755 --- a/nginx/default +++ b/nginx/default @@ -18,8 +18,4 @@ server { # Disable cache proxy_buffering off; } - - location /emu2/ { - proxy_pass http://127.0.0.1:6081/; - } } From b9d6237eb4f317dc5a93dc8cbff5c4ffc345649d Mon Sep 17 00:00:00 2001 From: butomo1989 Date: Wed, 1 Jul 2020 11:06:05 +0200 Subject: [PATCH 3/3] Added example to pass password through url --- README_CUSTOM_CONFIG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_CUSTOM_CONFIG.md b/README_CUSTOM_CONFIG.md index deca136..3000c4f 100644 --- a/README_CUSTOM_CONFIG.md +++ b/README_CUSTOM_CONFIG.md @@ -81,4 +81,4 @@ For the first run, this will create a new avd and all the changes will be access Nginx ----- -You can have 1 nginx service to handle multiple containers. Sample nginx configuration is [this](nginx/default) and sample call is ```http://127.0.0.1/container-1/?nginx=&path=/container-1/websockify&view_only=true``` +You can have 1 nginx service to handle multiple containers. Sample nginx configuration is [this](nginx/default) and sample call is ```http://127.0.0.1/container-1/?nginx=&path=/container-1/websockify&view_only=true&password=secr3t```