Skip to content

Instantly share code, notes, and snippets.

@hiteshjoshi
Last active November 2, 2016 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiteshjoshi/7998eee3a581911bca87cee58c8dcce1 to your computer and use it in GitHub Desktop.
Save hiteshjoshi/7998eee3a581911bca87cee58c8dcce1 to your computer and use it in GitHub Desktop.
nginx configuration
server {
#server_name _;
listen 80 default_server; # ipv4
proxy_read_timeout 3600;
root /usr/html; #SERVER PATH HERE
index index.html index.htm;
charset utf-8;
location / {
# Force IE into standards compatibility mode
add_header X-UA-Compatible: "chrome=1;IE=edge"; # Force IE into standards compatible mode
# Cache forever, but always revalidate
#add_header Cache-Control "max-age=31536000, must-revalidate";
try_files $uri /index.html =404;
}
location ^~ /assets/ {
#add_header Cache-Control: max-age=31536000;
# Allow cross origin access
add_header Access-Control-Expose-Headers "Access-Control-Allow-Origin";
add_header Access-Control-Allow-Origin "*";
}
location ~ ^/(auth|api) {
proxy_pass http://localhost:8080; #REPLACE PORT FOR API
}
error_page 404 /404.html;
error_page 502 /maintenance.html;
error_page 500 502 503 504 /50x.html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment