Nginx config draft
This commit is contained in:
parent
da9ec3482e
commit
103bdb212e
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue