1
0
Fork 0

Nginx config draft

This commit is contained in:
Gregory Eremin 2015-03-07 17:23:08 +07:00
parent da9ec3482e
commit 103bdb212e
2 changed files with 29 additions and 2 deletions

29
nginx.conf Normal file
View File

@ -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;
}
}

View File

@ -8,8 +8,6 @@ import (
func init() { func init() {
http.HandleFunc("/", sessionHandler) http.HandleFunc("/", sessionHandler)
http.HandleFunc("/hello", appHelloHandler)
http.HandleFunc("/app", appAppHandler)
http.HandleFunc("/auth/signin", authSigninHandler) http.HandleFunc("/auth/signin", authSigninHandler)
http.HandleFunc("/auth/callback", authCallbackHandler) http.HandleFunc("/auth/callback", authCallbackHandler)
http.HandleFunc("/api/", authHandler) http.HandleFunc("/api/", authHandler)