server {
  listen *:80;


  server_name           adguard.realm.local;

  index  index.html index.htm index.php;
  access_log            /var/log/nginx/adguard.realm.local.access.log combined;
  error_log             /var/log/nginx/adguard.realm.local.error.log;

  location / {
    return 301 https://$server_name$request_uri;
  }

}

server {
  listen       *:443 ssl;


  server_name  adguard.realm.local;

  ssl_certificate           /etc/nginx/ssl/certs/adguard.realm.local/cert.pem;
  ssl_certificate_key       /etc/nginx/ssl/certs/adguard.realm.local/key.pem;
  ssl_protocols             TLSv1.2;
  ssl_ciphers               ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK;

  index  index.html index.htm index.php;
  access_log            /var/log/nginx/ssl-adguard.realm.local.access.log combined;
  error_log             /var/log/nginx/ssl-adguard.realm.local.error.log;


  location / {
    proxy_pass            http://192.168.0.5;
    proxy_read_timeout    90s;
    proxy_connect_timeout 90s;
    proxy_send_timeout    90s;
    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_set_header      Proxy "";
  }
}
