nginx:
server {
listen 80;
server_name www.taotao.com taotao.com;
#charset koi8-r;
#access_log logs/host.access.log main;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host; #代理頭信息添加Host
set $staticIndex "C:/taotao-index/";
root $staticIndex;
location ~*(/|/index.html)$ {
set $indexHtml $staticIndex/index.html;
if (!-e $indexHtml ){
proxy_pass http://127.0.0.1:8082;
# break;
}
rewrite $indexHtml break;
proxy_connect_timeout 600;
proxy_read_timeout 600;
}
location / {
proxy_pass http://127.0.0.1:8082;
proxy_connect_timeout 600;
proxy_read_timeout 600;
}
}
Linux:
生成html命令:
wget -O/tmp/index.html http://www.baidu.com/ && echo "<div style='display:none'>Created: `date -d today +"%Y-%m-%d %H:%M:%S"`<div>" >> /tmp/index.html
創建shell腳本:
#!/bin/bash
wget -O/tmp/index.html http://www.baidu.com/ && echo "<div style='display:none'>Created: `date -d today +"%Y-%m-%d %H:%M:%S"`<div>" >> /tmp/index.html
添加系統任務(每一分鐘執行一次):
crontab -e
*/1 * * * * sh /tmp/index.sh