1.配置Nginx/FastCGI
This is actually pretty easy. I assume you already have some experience configuring Nginx.conf. (Each install seemingly has different defaults as to the conf file's location,and contents,so I won't go over it here. Mine is in /usr/local/etc/Nginx.)
I assume too that you've configured PHP with FastCGI before. If not,you may still understand what's happening.
All you have to do is tell Nginx to pass certain requests,or maybe all of them if you wish,to FastCGI on a certain port. Our Go program will have a FastCGI handler listening on that same port. If you need a reference,my entire server { ... }block looks like this:
@H_404_17@
server {
@H_404_17@
listen 80;