Answer the question
In order to leave comments, you need to log in
How to output go response through nginx?
Given:
Golang is installed on the system, the command usr/local/go/bin/hello
returns Hello world!
Nginx opens the standard stub Welcome to nginx!
Open etc/nginx/sites-enabled/default
Change root /var/www/html;
to root /usr/local/go/bin/hello;
Answer Welcome to nginx! disappears, now instead of it 404 Not Found.
The directory cd usr/local/go/bin/hello doesn't exist. hello is a file in the go/bin directory
Answer the question
In order to leave comments, you need to log in
You are cooking it completely wrong. You are trying to do it in CGI style.
You need to raise the http server in the go, using the net / http package or some framework of your choice and redirect requests from Nginx to it via proxy-pass.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question