Sign inSign up

nickleefly/nginx-proxy-google

By nickleefly

•Updated almost 8 years ago

alpine nginx google proxy

Image
0

370

nickleefly/nginx-proxy-google repository overview

github repo: https://github.com/nickleefly/nginx-proxy-google⁠

⁠nginx-proxy-google Build Status CircleCI

Inspired by ngx_http_google_filter_module⁠

⁠Base Docker Image

⁠Usage

You can either pull automated build⁠ from Docker Hub or build the image by yourself.

⁠Pull from Docker Hub
docker pull nickleefly/nginx-proxy-google
⁠Build the image by yourself
git clone https://github.com/nickleefly/nginx-proxy-google
  • Build an image from Dockerfile
docker build -t nickleefly/nginx-proxy-google .

⁠Run

docker run --restart always -d -p 80:80 -p 443:443 --name nginx nickleefly/nginx-proxy-google
⁠Custom google.conf

Example google.conf⁠

server {
    listen 80;

    server_name example.com;

    location / {
        google on;
        google_scholar on;
        google_language "en";
    }

    # 屏蔽spider
    if ($http_user_agent ~* (baiduspider|360spider|haosouspider|googlebot|soso|bing|sogou|yahoo|sohu-search|yodao|YoudaoBot|robozilla|msnbot|MJ12bot|NHN|Twiceler)) {
        return  403;
    }
}
docker run --restart always -d -p 80:80 -p 443:443 \
-v path/to/google.conf:/etc/nginx/conf.d/google.conf \
--name nginx nickleefly/nginx-proxy-google

Tag summary

Content type

Image

Digest

Size

3.7 MB

Last updated

almost 8 years ago

docker pull nickleefly/nginx-proxy-google