您好,登錄后才能下訂單哦!
在nginx子配置文件中加下面加粗字體部分
location / {
proxy_pass http://static;
proxy_redirect off;
proxy_set_header Host $host;
proxysetheader backendIP $upstreamaddr; #要代理的服務(wù)器的地址
proxysetheader backendCode $upstreamstatus; #要代理的服務(wù)器的狀態(tài)
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
在主配置文件中
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
'"$upstream_addr" "$upstream_status"';
即可通過tailf /var/log/nginx/access.log 查看到
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。