From b5bd6779f93e7bb4aa4165378b6448e6ee0128f3 Mon Sep 17 00:00:00 2001 From: codeskyblue Date: Tue, 6 Apr 2021 10:52:25 +0800 Subject: [PATCH] fix #105 --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 3ccaac9..cdc8834 100644 --- a/README.md +++ b/README.md @@ -264,6 +264,35 @@ gohttpserver should started with `--xheaders` argument when behide nginx. Refs: +gohttpserver also support `--prefix` flag which will help to when meet `/` is occupied by other service. relative issue + +Usage example: + +```bash +# for gohttpserver +./gohttpserver --prefox /foo --addr :8200 --xheaders +``` + +**Nginx settigns** + +``` +server { + listen 80; + server_name your-domain-name.com; + + location /foo { + proxy_pass http://127.0.0.1:8200; # here need to change + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + client_max_body_size 0; # disable upload limit + } +} +``` + ## FAQ - [How to generate self signed certificate with openssl](http://stackoverflow.com/questions/10175812/how-to-create-a-self-signed-certificate-with-openssl)