Skip to content

Instantly share code, notes, and snippets.

原文

新老用户都可能遇到陷阱。下面我们列出频繁出现的问题,以及如何解决。 在 Freenode IRC #nginx 频道,我们经常看到这些问题。

[TOC]

关于本指南

最常见的是有人试图从其他指南拷贝配置片段。并非所有的指南是错误的,但绝大部分是有问题的。

// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// HTTP reverse proxy handler
package httputil
import (
"io"
@starchou
starchou / drop-table.sh
Last active August 29, 2015 14:25
删除数据库中的一定规则(t_message_20150102)的表
#!/bin/bash
# A shell script to delete / drop all tables from MySQL database.
# Usage: ./script user password dbnane
# Usage: ./script user password dbnane server-ip
# Usage: ./script user password dbnane mysql.nixcraft.in
# -------------------------------------------------------------------------
# Copyright (c) 2008 nixCraft project <http://www.cyberciti.biz/fb/>
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
@starchou
starchou / gist:cf059f7f9e939d1eda55
Created January 17, 2015 10:50
simple pool of golang
var (
MAX_POOL_SIZE = 20
ch chan *Client
)
func getPool() *Client {
if ch == nil {
ch = make(chan *Client, MAX_POOL_SIZE)
@starchou
starchou / testmssql.go
Created June 5, 2014 07:43
the demo of github.com/denisenkom/go-mssqldb
package main
import (
"database/sql"
"fmt"
_ "github.com/denisenkom/go-mssqldb"
)
func main() {
DB, err := sql.Open("mssql", "server=172.16.32.1**;port=1433;user id=sa;password=*****;database=demo;")
package main
import (
"flag"
"fmt"
"github.com/miekg/dns"
"os"
)
var (