server {
    listen gerbera.DOMAINNAME:80;
    server_name gerbera.DOMAINNAME;

    location / {
        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   X-Forwarded-Host   $host:$server_port;
        proxy_set_header   X-Forwarded-Server $host;

        # install sub filter module and enable in nginx.conf
        # load_module /usr/lib64/nginx/modules/ngx_http_subs_filter_module.so;
        sub_filter_once    off;
        sub_filter_types   text/html application/json;
        sub_filter         'http://GERBERA_IP:GERBERA_PORT' 'http://$host:$server_port';

        proxy_pass         http://GERBERA_IP:GERBERA_PORT/;
    }
}
