mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Improve reverse proxy support
Should address edge cases and close #224 -- subject to field testing. Does require the NGINX deployments use the following: proxy_pass <http://documize-url:5001>; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-For $remote_addr;
This commit is contained in:
parent
9e3eac19aa
commit
1da49974cb
20 changed files with 2108 additions and 731 deletions
|
@ -23,6 +23,7 @@ import (
|
|||
"github.com/documize/community/domain/store"
|
||||
"github.com/documize/community/server/routing"
|
||||
"github.com/documize/community/server/web"
|
||||
"github.com/gorilla/handlers"
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
|
@ -77,6 +78,9 @@ func Start(rt *env.Runtime, s *store.Store, ready chan struct{}) {
|
|||
negroni.Wrap(routing.BuildRoutes(rt, routing.RoutePrefixRoot)),
|
||||
))
|
||||
|
||||
// Look out for reverse proxy headers.
|
||||
router.Use(handlers.ProxyHeaders)
|
||||
|
||||
n := negroni.New()
|
||||
n.Use(negroni.NewStatic(web.StaticAssetsFileSystem()))
|
||||
n.Use(negroni.HandlerFunc(cm.cors))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue