jlesage/firefox
是一个web版firefox浏览器,可以使用docker中运行web版浏览器,很是方便。
运行命令
docker run -d \
--name=firefox \
-p 5800:5800 \
-v /docker/appdata/firefox:/config:rw \
jlesage/firefox
中文乱码异常
查阅GitHub
文档发现有一个环境变量可以解决这个问题;
ENABLE_CJK_FONT
:When set to 1, open-source computer font WenQuanYi Zen Hei is installed. This font contains a large range of Chinese/Japanese/Korean characters.
默认是0,这个意思是 当设置为1时,将安装开源计算机字体WenQuanYi Zen Hei。此字体包含大量中文/日文/韩文字符。
能解决这个异常问题;
安全问题
如果暴露在外网后,容易遭受攻击,所以该容器又提供了一个密码设置的环境变量VNC_PASSWORD
docker run -d \
--name=firefox \
-p 5800:5800 \
-v /docker/appdata/firefox:/config:rw \
-e VNC_PASSWORD=123456 \
jlesage/firefox
Nginx 反代配置
参考文档,配置如下:
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream docker-firefox {
# If the reverse proxy server is not running on the same machine as the
# Docker container, use the IP of the Docker host here.
# Make sure to adjust the port according to how port 5800 of the
# container has been mapped on the host.
server 127.0.0.1:5800;
}
server {
[...]
server_name firefox.domain.tld;
location / {
proxy_pass http://docker-firefox;
}
location /websockify {
proxy_pass http://docker-firefox;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 86400;
}
}
二级目录
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream docker-firefox {
# If the reverse proxy server is not running on the same machine as the
# Docker container, use the IP of the Docker host here.
# Make sure to adjust the port according to how port 5800 of the
# container has been mapped on the host.
server 127.0.0.1:5800;
}
server {
[...]
location = /firefox {return 301 $scheme://$http_host/firefox/;}
location /firefox/ {
proxy_pass http://docker-firefox/;
# Uncomment the following line if your Nginx server runs on a port that
# differs from the one seen by external clients.
#port_in_redirect off;
location /firefox/websockify {
proxy_pass http://docker-firefox/websockify/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 86400;
}
}
}
-e VNC_PASSWORD=123456;ENABLE_CJK_FONT=1 \
这样?
套娃浏览器是吧
对,套娃
飞牛自带了一个。
飞牛那个我还没试过,有空试试
搭建过,因为某个服务忘记了。
后来发现用处不大。
服务组网后,用途确实不大。