1
0
mirror of https://github.com/dokku/buildpack-nginx.git synced 2024-11-05 19:48:43 +00:00
buildpack-nginx/conf/nginx.conf.erb
Matthias Langhard bb6e9d398d Forwards requests to index.html after no file or folder was found
Useful for SPA's like AngularJS where the SPA's router takes care of the routing.
2016-06-28 13:45:23 +02:00

28 lines
434 B
Plaintext

worker_processes 1;
error_log stderr;
pid nginx.pid;
daemon off;
events {
worker_connections 768;
}
http {
types_hash_max_size 2048;
include mime.types;
server {
listen <%= ENV["PORT"] %>;
server_name _;
<% if ENV["ROOT"] %>
root /app/www/<%= ENV["ROOT"] %>;
<% else %>
root /app/www;
<% end %>
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
}