Added example of using nginx

This commit is contained in:
butomo1989 2020-06-26 16:01:12 +02:00
parent 7ad2eb45c8
commit 0460a62956
2 changed files with 30 additions and 0 deletions

View file

@ -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```

25
nginx/default Executable file
View file

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