I'm trying to make my stats with awstats-7.7
.
Everything works fine.
Now I'm trying to use google, type a keyword that brings me to my site.
Then I trace the log to see where I come from, and the keywords.
Here's the (important) log line output:
www.mysite.fr - www.mysite.fr - 7.24.15.16 - - [28/Nov/2018:07:45:31 +0100] "GET / HTTP/1.1" 200 27636 "https://www.google.fr/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36" "-"
As you can see, in the /var/log/nginx/proxy-access.mysite.log
there's no information about search. I'm probably missing a directive, but I dont know which one, here's my website Nginx configuration:
server {
listen *:443 ssl;
server_name www.mysite.fr;
index index.html index.htm;
access_log /var/log/nginx/proxy-access.mysite.log proxylog;
error_log /var/log/nginx/proxy-error.log error;
ssl_certificate /var/lib/acme/live/www.mysite.fr/fullchain;
ssl_certificate_key /var/lib/acme/live/www.mysite.fr/privkey;
ssl_trusted_certificate /var/lib/acme/live/www.mysite.fr/chain;
ssl_stapling on;
ssl_stapling_verify on;
location '/.well-known/acme-challenge' {
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-Server $host;
proxy_pass http://acmetool;
}
location / {
include denied_clients;
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-Server $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://apache/;
}
}
Which directive am I missing?
You aren't missing anything in your configuration.
The problem is that browsers can be configured to not send complete referer URLs. For instance, Firefox has numerous settings to control when to send a referer and how much of it to send. Chrome strips the path from the referer when the request is to a different site, and users may be using an extension for further control.
Proxies can also strip referer information as well for security reasons, even if browsers send it.