Skip to content

Commit b5bd677

Browse files
committed
fix #105
1 parent 8665999 commit b5bd677

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,35 @@ gohttpserver should started with `--xheaders` argument when behide nginx.
264264

265265
Refs: <http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size>
266266

267+
gohttpserver also support `--prefix` flag which will help to when meet `/` is occupied by other service. relative issue <https://github.com/codeskyblue/gohttpserver/issues/105>
268+
269+
Usage example:
270+
271+
```bash
272+
# for gohttpserver
273+
./gohttpserver --prefox /foo --addr :8200 --xheaders
274+
```
275+
276+
**Nginx settigns**
277+
278+
```
279+
server {
280+
listen 80;
281+
server_name your-domain-name.com;
282+
283+
location /foo {
284+
proxy_pass http://127.0.0.1:8200; # here need to change
285+
proxy_redirect off;
286+
proxy_set_header Host $host;
287+
proxy_set_header X-Real-IP $remote_addr;
288+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
289+
proxy_set_header X-Forwarded-Proto $scheme;
290+
291+
client_max_body_size 0; # disable upload limit
292+
}
293+
}
294+
```
295+
267296
## FAQ
268297
- [How to generate self signed certificate with openssl](http://stackoverflow.com/questions/10175812/how-to-create-a-self-signed-certificate-with-openssl)
269298

0 commit comments

Comments
 (0)