2016-08-11 117 views
0

我有Nginx的1.8.1上端口的Amazon EC2服务器设置端口80和Apache 2.4 8080Nginx的错误日志 - 无效的本地地址

我的Nginx的错误日志充满了无效的本地地址“www.domain .com:80“

有人可以建议如何解决这个错误?

我下domain.com的/ etc/nginx的/启用的站点,如下面

server { 
listen 80; 
server_name domain.com www.domain.com; 
root /home/domain/public_html/; 
index index.php index.htm index.html; 

location/{ 
      #try_files $uri $uri/ /index.php; 
      #try_files $uri $uri/ $uri.php; 
      try_files $uri $uri/ /index.php?/$request_uri; 
} 

location ~ \.php$ { 
    proxy_bind $host:80; 
    proxy_pass http://www.domain.com:8080; 
    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-Proto $scheme; 
    add_header X-Cache-Status $upstream_cache_status; 

    # Cache configuration 
    proxy_cache my-cache; 
    proxy_cache_valid 10s; 
    proxy_no_cache $cookie_PHPSESSID; 
    proxy_cache_bypass $cookie_PHPSESSID; 
    proxy_cache_key "$scheme$host$request_uri"; 
} 

    # Disable Cache for the file type html, json 
    location ~* .(?:manifest|appcache|html?|xml|json)$ { 
      expires -1; 
    } 

    # Enable Cache the file 30 days 
    location ~* .(jpg|png|gif|jpeg|css|mp3|wav|swf|mov|doc|pdf|xls|ppt|docx|pptx|xlsx)$ { 
      proxy_cache_valid 200 120m; 
      expires 30d; 
      proxy_cache my-cache; 
      #access_log off; 
      add_header X-Cache-Status $upstream_cache_status; 
    } 

location ~ /\. { 
    access_log off; 
    log_not_found off; 
    deny all; 
} 

}

我在Apache虚拟主机domain.com是如下

<VirtualHost 172.31.xx.xxx:8080> 
    DocumentRoot /home/domain/public_html/ 
    ServerName domaine.com 
    ServerAlias www.domain.com n1.domain.com 
    ErrorLog /home/domain/logs/error_log 
    CustomLog /home/domain/logs/access_log combined 
    <Directory /home/domain/public_html> 
      Options -Includes -ExecCGI 
      AllowOverride All 
    </Directory> 

+2

是否有任何特别的原因,为什么你有'proxy_bind $ host:80;'指令?如果没有,请将其删除,并且应该停止该错误(请注意,如果您选择走这条路线,那么您绑定的地址必须是本地的) –

+0

我已经复制了codeigniter的nginx设置,并且它工作完美,除了日志中令人讨厌的错误。 正如你所建议的,我删除了伪指令proxy_bind $ host:80,并且此错误已消失。 – koolnyze

+0

我明白了。将来我会很有用地将它包括在问题的描述中。我很高兴能够提供帮助。请接受它作为答案:) –

回答

0

是否有任何特别原因,为什么你有proxy_bind $host:80;指令?如果没有,请将其删除,并且应该停止该错误(请注意,如果您选择了该路线,那么您绑定的地址必须是本地的)。