Commit 5315cffa authored by Eric Zheng's avatar Eric Zheng

software/headless-chromium: fix proxy configuration

The nginx proxy configuration now works with websockets. It's now possible to use the remote debugging port from another machine! Note that you'll need to manually change the ws=[ip:port] parameter in the URL to wss=[server-cdn-url] still. I will see if I can patch the frontend page to not require this, but I wanted to commit a working version first.
parent 7ad04ad3
......@@ -4,7 +4,7 @@ md5sum = 84fc2eddea2d5fcbabef54b66eb34cb7
[instance-headless-chromium]
_update_hash_filename_ = instance_headless-chromium.cfg.in
md5sum = c0c787f11c54db7aea3ee97cb1158245
md5sum = 73ced594be9d9360f57310c840274348
[template-chromium-launcher]
_update_hash_filename_ = templates/launcher.in
......@@ -12,7 +12,7 @@ md5sum = 578df08913415c427486093787b4aea6
[template-nginx-conf]
_update_hash_filename_ = templates/nginx.conf.in
md5sum = f7c24a1d3abe53b9312a3885dada5864
md5sum = 297b09e8732be8fbc406eff3c6a1cb7b
[template-nginx-launcher]
_update_hash_filename_ = templates/nginx_launcher.in
......
......@@ -79,4 +79,6 @@ software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/a
slave = true
config-url = ${headless-chromium:proxy_url}
config-https-only = true
config-type = websocket
config-websocket-path-list = /devtools
return = domain secure_access
......@@ -17,9 +17,22 @@ http {
uwsgi_temp_path {{ param_chromium_headless['nginx_temp_path'] }};
scgi_temp_path {{ param_chromium_headless['nginx_temp_path'] }};
# The proxy must set the Host header to an IP address, since the headless Chromium shell refuses to run otherwise, for security reasons.
location /devtools {
proxy_http_version 1.1;
proxy_set_header Host [{{ param_chromium_headless['ip'] }}]:{{ param_chromium_headless['remote-debugging-port'] }};
# TODO: do we really need to manually set the Upgrade and Connection headers anymore?
proxy_set_header Upgrade "websocket";
proxy_set_header Connection "Upgrade";
proxy_pass http://[{{ param_chromium_headless['ip']}}]:{{ param_chromium_headless['remote-debugging-port'] }};
}
location / {
proxy_http_version 1.1;
proxy_pass http://[{{ param_chromium_headless['ip'] }}]:{{ param_chromium_headless['remote-debugging-port'] }};
proxy_set_header Host [{{ param_chromium_headless['ip'] }}]:{{ param_chromium_headless['remote-debugging-port'] }};
proxy_pass http://[{{ param_chromium_headless['ip']}}]:{{ param_chromium_headless['remote-debugging-port'] }};
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment