upstream empact { server 127.0.0.1:8080; # Server with enabled profiling # server 127.0.0.1:8080 weight=10; # server 127.0.0.1:8081 max_fails=1 fail_timeout=30s; } server { listen 80 default_server; root /home/www/empact/build; charset utf-8; location ~ ^/app/ { add_header Cache-Control private; add_header X-UA-Compatible IE=edge; add_header Content-Language en; rewrite ^/app/(.*) /app.html last; } location ~ ^/(auth|api)/ { add_header Cache-Control private; proxy_pass http://empact; } location /favicon.ico { alias /home/www/empact/build/images/favicon.ico; add_header Cache-Control public; expires 1d; } location ~ .*\.(js|css|png)$ { add_header Cache-Control public; add_header Last-Modified $sent_http_Expires; expires 1h; etag on; gzip_static on; gzip on; gzip_proxied any; gzip_vary on; } }