You are not logged in.

#1 2015-04-26 20:41:59

DerJudge
Member
From: NRW, Germany
Registered: 2013-03-26
Posts: 24
Website

[SOLVED] nginx reverse proxy = adsense not working?

Hi everyone,

I run several sites, which I'm moving to a different server in the next weeks. To make some prearrangements on this, I want to switch all the DNS entries to point to the new IPs. On the new server, there is an nginx reverse proxy working, which fetches all the content from the Webservers, still running on the old IPs and display the sites. When this has been done and all the sites are served from the new servers, the plan is to keep a reverse proxy in front of the sites for speed and security reasons.

When I tested this with a very small hobby-site (static HTML), technically all works perfect, but I noticed the Google AdSense-Banner isn't loading anymore.
The site where you can actually see this happening ist www.bardor.de ; the following is a screenshot which shows the code and rendered layout where the ad should be placed (and it did before I added the proxy):

ff-src2.jpg

This banner is active in Adsense:

adsense.jpg

My nginx-config is the following:

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log  warn;

pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    open_log_file_cache max=1000 inactive=20s min_uses=2;
    access_log /var/log/nginx/access.log combined buffer=50k flush=5m;

    sendfile       on;
    tcp_nopush     on;

    keepalive_timeout  90;

    gzip  on;

    server {
	  server_name [url=http://www.bardor.de]www.bardor.de[/url] bardor.de;
      listen 80;
      client_max_body_size  100M;
      access_log /var/log/nginx/bardor.de_access.log combined buffer=50k flush=5m;
      error_log  /var/log/nginx/bardor.de_error.log  error;

      location / {
        proxy_pass          [url]http://188.128.75.55:8080/[/url];
	    proxy_set_header Host $http_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-Proto $scheme;
		proxy_connect_timeout       90;
		proxy_send_timeout          300;
		proxy_read_timeout          300;
	  }
    }
}

Can anybody give me an idea about why this isn't working with adsense?

Thanks for minding.

Marc

PS: Sorry, nevermind. It did not work for days now. Today, it magically shows up ... thanks for minding and sorry for spreading "crap" wink

Last edited by DerJudge (2015-04-27 09:50:48)

Offline

Board footer

Powered by FluxBB