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/; + } +}