在站点页面和主页上的某些时间之间切换时显示 502 错误网关错误,但不是主页上的第一个请求,只有在另一个页面重定向到它时才会显示。它发生在一些 javascript 文件中
在两个上游配置的负载均衡 php1 php2 都是 apache 服务器。
当我检查错误日志时,我喜欢:
no live upstreams while connecting to upstream
[error] 27212#0: *314 no live upstreams while connecting to upstream, client: ip_address , server: example.com, request: "GET / HTTP/1.1", upstream: "http://example.com", host: "example.com", referrer: "http://example.com/mypages/"
Run Code Online (Sandbox Code Playgroud)
这是负载平衡服务器配置
upstream example.com {
# ip_hash;
server php01 max_fails=3 fail_timeout=15s;
server php02 max_fails=3 fail_timeout=15s;
}
server {
listen IP:80;
server_name example.com;
access_log /var/log/nginx/example.com.access;
error_log /var/log/nginx/example.com.error error;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header …
Run Code Online (Sandbox Code Playgroud) 我有一个 8GB 的文件,调用php.log
了一个正在运行的 php 脚本登录到它。记录每个事件对我来说很重要,我想压缩它并清空当前文件而不停止 Web 服务器。
如果我运行:
mv php.log php.log.backup20140305-01
touch php.log
Run Code Online (Sandbox Code Playgroud)
我会丢失一些数据。如何在不丢失任何数据的情况下执行此操作?