-
-
Save ismiyati/aedf6cd77fb923b756f908bd61e0ee60 to your computer and use it in GitHub Desktop.
Revisions
-
atomaths revised this gist
Dec 23, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,13 +6,13 @@ server { } } ## Reverse Proxy (이 방식으로 하면 http.ListenAndServe로 해야함) server { listen 80; # listen 443 ssl; server_name api.golang.org; location ~ / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; -
atomaths revised this gist
Dec 23, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,15 @@ ## FastCGI server { location ~ /app.* { fastcgi_pass 127.0.0.1:9000; include fastcgi_params; } } ## Reverse Proxy server { listen 80; # listen 443 ssl; server_name api.golang.org; location / { -
atomaths revised this gist
Dec 23, 2013 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,12 @@ // FastCGI server { location ~ /app.* { fastcgi_pass 127.0.0.1:9000; include fastcgi_params; } } // Reverse Proxy server { listen 80; // listen 443 ssl; -
atomaths revised this gist
Dec 23, 2013 . 1 changed file with 13 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,4 +3,17 @@ server { fastcgi_pass 127.0.0.1:9000; include fastcgi_params; } } server { listen 80; // listen 443 ssl; server_name api.golang.org; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://127.0.0.1:3000; } } -
atomaths revised this gist
Apr 23, 2013 . 1 changed file with 15 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ // 아래처럼 HandleFunc를 등록해서도 처리가능 func main() { http.HandleFunc("/foo", fooHandler) l, err := net.Listen("tcp", "127.0.0.1:9000") if err != nil { panic(err) } fcgi.Serve(l, nil) } func fooHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello") } -
atomaths created this gist
Apr 17, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ server { location ~ /app.* { fastcgi_pass 127.0.0.1:9000; include fastcgi_params; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ package main import ( "fmt" "net/http" "net/http/fcgi" "net" ) type FastCGIServer struct{} func (s FastCGIServer) ServeHTTP(w http.ResponseWriter, req *http.Request) { w.Write([]byte("This is a FastCGI example server.\n")) } func main() { fmt.Println("Starting server...") l, _ := net.Listen("tcp", "127.0.0.1:9000") b := new(FastCGIServer) fcgi.Serve(l, b) }