Skip to content

Instantly share code, notes, and snippets.

@vojty
Last active August 29, 2015 14:00
Show Gist options
  • Save vojty/7fcfb53a99b3d7542eaa to your computer and use it in GitHub Desktop.
Save vojty/7fcfb53a99b3d7542eaa to your computer and use it in GitHub Desktop.
AngularJS HTML5 mode + Nginx + socket.io
server {
listen 80
server_name example
location / {
root /var/www/your/app;
if (!-e $request_filename){ # handles page reload
rewrite ^(.*)$ /views/index.html break;
}
index /views/index.html;
}
location /socket.io {
proxy_pass http://localhost:9000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
}
}
# http://www.ng-newsletter.com/posts/serious-angular-seo.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment