使用docker部署谷歌镜像

  • 2019 年 11 月 22 日
  • 笔记

首先

docker run -p 8020:80 -d bohan/onemirror

然后修改本机的nginx配置,准备好证书(申请免费证书),就像这样。

server {      listen      80;      server_tokens       off;      #access_log  /var/log/nginx/web2.access.log main;      server_name gfw.superpig.win;      location ^~ / {          rewrite ^ https://$server_name:443$request_uri? permanent;      }  }    server{          listen 443 ssl;          server_name gfw.superpig.win;          gzip on;          gzip_proxied any;          gzip_min_length 1024;          gzip_comp_level 3;          gzip_types text/plain text/javascript text/css text/json application/javascript  application/json image/jpeg image/gif image/png;            ssl on;          ssl_certificate /etc/letsencrypt/live/gfw.superpig.win/fullchain.pem;          ssl_certificate_key /etc/letsencrypt/live/gfw.superpig.win/privkey.pem;          ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;          ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;          ssl_prefer_server_ciphers on;              location / {                  proxy_pass http://0.0.0.0:8020;                 # proxy_set_header Host $host;                  # proxy_set_header X-Forwarded-Ssl off;                 # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;                  # proxy_set_header X-Forwarded-Port 80;          #proxy_set_header X-Forwarded-Proto  $scheme;            proxy_set_header Host $host;          proxy_set_header X-Real-IP $remote_addr;          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;          proxy_redirect     off;          ### Most PHP, Python, Rails, Java App can use this header -> https ###          proxy_set_header X-Forwarded-Proto  $scheme;    }    }