Last active
November 2, 2016 06:42
-
-
Save hiteshjoshi/7998eee3a581911bca87cee58c8dcce1 to your computer and use it in GitHub Desktop.
nginx configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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