summarylogtreecommitdiffstats
path: root/google.conf
blob: 9bae3c02d6e0b7432cf5331ce83c3fca0b3ff787 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# vim: ft=nginx:
# Sample configuration for ngx_http_google_filter_module
# This file should be included in an `http` context
# See also: https://github.com/cuber/ngx_http_google_filter_module

server {
  listen 80;
  listen 443 ssl;

  # You can generate self-signed certificate and key with one command:
  # openssl req -x509 -newkey rsa:2048 -nodes -keyout google.example.org.key -out google.example.org.crt -days 30 -subj /CN=google.example.org/
  # But it's strongly recommended to get a valid certificate.
  server_name          google.example.org;
  ssl_certificate      google.example.org.crt;
  ssl_certificate_key  google.example.org.key;

  # Improve TLS performance and security
  ssl_session_cache    shared:SSL:10m;
  ssl_protocols        TLSv1.2;
  ssl_ciphers          ECDHE+AES;
  ssl_prefer_server_ciphers  on;

  # Google on!
  location / {
    google on;
    google_scholar on;
    google_language en;
  }

  # `resolver` is needed to resolve domains.
  resolver 8.8.8.8;

  # `upstream` can help you to avoid name resolving cost, decrease the
  # possibility of google robot detection and proxy through some
  # specific servers.
  #upstream www.google.com {
  #  server 173.194.38.1:443;
  #  server 173.194.38.2:443;
  #  server 173.194.38.3:443;
  #  server 173.194.38.4:443;
  #}
}