location ^~ /webpath/ { set$prerender0; if ($http_user_agent~* "baiduspider|twitterbot|facebookexternalhit|rogerbot|embedly|quora link preview|showyoubot|outbrain|pinterest|slackbot|vkShare|W3C_Validator") { set $prerender 1; }
# 谷歌推荐的配置方式 if ($args ~ "_escaped_fragment_") { set $prerender 1; }
if ($prerender = 1) { # 官方推荐通过$prerender变量来进行跳转来解决NGINX缓存 set $prerender "127.0.0.1:3000";
do_start() { echo -n $"Starting $SERVER: " pid=$(app_pid) if [ -n "$pid" ] then echo"$APPNAME is already running (pid: $pid)" else if [ ! -w $LOG_FILE ] then if [ ! -e $LOG_FILE ] then touch $LOG_FILE fi chown $USER$LOG_FILE fi echo"$APPNAME is not running - starting it up!" runuser --shell=/bin/bash -l "$USER" -c "$DAEMON$SERVER >> $LOG_FILE 2>&1 &" pid=$(app_pid) echo$pid > ${PIDFILE} do_status RETVAL=$? echo [ $RETVAL -eq 0 ] fi return 0 }
do_wait() { echo"Waiting for process to exit"; pid=$(app_pid) if [ -n "$pid" ] then let kwait=$SHUTDOWN_WAIT count=0; until [ `ps -p $pid | grep -c $pid` = '0' ] || [ $count -gt $kwait ] do echo -n -e "\nwaiting for processes to exit"; sleep 1 let count=$count+1; done fi return 0 }
do_status() { pid=$(app_pid) if [ -n "$pid" ] then echo -n "$APPNAME is running (pid: $pid)" echo_success else echo -n "$APPNAME is not running" echo_failure fi echo return 0 }