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>
是否有任何特別的原因,爲什麼你有'proxy_bind $ host:80;'指令?如果沒有,請將其刪除,並且應該停止該錯誤(請注意,如果您選擇走這條路線,那麼您綁定的地址必須是本地的) –
我已經複製了codeigniter的nginx設置,並且它工作完美,除了日誌中令人討厭的錯誤。 正如你所建議的,我刪除了僞指令proxy_bind $ host:80,並且此錯誤已消失。 – koolnyze
我明白了。將來我會很有用地將它包括在問題的描述中。我很高興能夠提供幫助。請接受它作爲答案:) –