Skip to content

Instantly share code, notes, and snippets.

@ties
Created February 9, 2015 19:08
Show Gist options
  • Save ties/cffd50a17afca48bfb26 to your computer and use it in GitHub Desktop.
Save ties/cffd50a17afca48bfb26 to your computer and use it in GitHub Desktop.
server {
listen 80;
listen [::]:80 ipv6only=on;
server_name [host].dev;
root /Users/[docroot];
index index.html index.htm;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.html;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
location /api/ {
proxy_pass http://[url]/api/;
proxy_redirect http://[url]/api/ $scheme://$host/api/;
# HTTP auth?
# proxy_hide_header "WWW-Authenticate";
# base64.b64encode("username:password".encode("ascii"))
# proxy_set_header Authorization "Basic [base64here]";
add_header Access-Control-Allow-Origin "*";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment