Nginx代理传递显示数字,而不是url

您好我试图使用代理传递谷歌analytics.js所以它可以存储在本地,并让它浏览器caching。

代理程序通行证,但是代理程序要求的url是https://[2607:f8b0:4006:800::200e]:443/analytics.js?v=1505856563

它应该是https://www.google-analytics.com/analytics.js?v=1505856563

这里是nginx.conf,在底部find代理通行证

user www-data; worker_processes auto; pid /run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE ssl_prefer_server_ciphers on; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; gzip on; gzip_disable "msie6"; # gzip_vary on; # gzip_proxied any; # gzip_comp_level 6; # gzip_buffers 16 8k; # gzip_http_version 1.1; # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; server { location = /analytics.js { proxy_pass https://www.google-analytics.com; expires 1y; } } } 

错误日志显示了这一点

 2017/09/19 21:29:23 [error] 6494#6494: *31 connect() to [2607:f8b0:4006:800::200e]:443 failed (101: Network is unreachable) while connecting to upstream, client: 162.158.62.90, server: seodevs.com, request: "GET /analytics.js?v=1505856563 HTTP/1.1", upstream: "https://[2607:f8b0:4006:800::200e]:443/analytics.js?v=1505856563", host: "www.seodevs.com", referrer: "https://www.seodevs.com/analytics.js?v=1505856563" 

我在完全丧失,为什么这是行不通的。

这里也是域名nginx文件。

 server { client_max_body_size 200M; listen 8080; listen [::]:8080; listen 443; ssl on; ssl_certificate /etc/nginx/certs/seodevs_cert.pem; ssl_certificate_key /etc/nginx/certs/seodevs_key.key; server_name seodevs.com www.seodevs.com; root /var/www/seodevs.com/html; location = /analytics.js { # Proxy to google-analytics.com proxy_pass https://www.google-analytics.com; # Custom expires time expires 1y; } port_in_redirect off; index index.html index.htm index.php; keepalive_timeout 65; location / { try_files $uri $uri/ /index.php?$args; } location ~* \.(jpg|jpeg|png|gif|ico|css|js|woff)$ { expires 365d; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi_params; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass unix:/run/php/php7.1-fpm.sock; } } 

任何帮助将非常感激。 把头发拉出来。