diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..c509905 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,29 @@ +upstream empact { + server 127.0.0.1:8080 max_fails=3 fail_timeout=30s; +} + +server { + listen 80 default_server; + root /home/empact/app/static; + charset utf-8; + + location / { + index hello.html; + } + location ~ ^/app/ { + rewrite ^/app/(.*) /app.html last; + } + + location ~ ^/(auth|api)/ { + proxy_pass http://empact; + } + + location ~ .*\.(js|css|png)$ { + add_header Cache-Control public; + expires max; + gzip_static on; + gzip on; + gzip_proxied any; + gzip_vary on; + } +} diff --git a/server/server.go b/server/server.go index b1ff10e..7ecf72e 100644 --- a/server/server.go +++ b/server/server.go @@ -8,8 +8,6 @@ import ( func init() { http.HandleFunc("/", sessionHandler) - http.HandleFunc("/hello", appHelloHandler) - http.HandleFunc("/app", appAppHandler) http.HandleFunc("/auth/signin", authSigninHandler) http.HandleFunc("/auth/callback", authCallbackHandler) http.HandleFunc("/api/", authHandler)