diff --git a/default.conf b/default.conf new file mode 100644 index 0000000..59c7732 --- /dev/null +++ b/default.conf @@ -0,0 +1,33 @@ +server { + listen 80; + server_name localhost; + + # redirect /google/ to /gcp/ for any subpath + location /google/ { + rewrite ^/google/(.*)/$ /gcp/$1/ last; + rewrite ^/google/(.*)$ /gcp/$1 last; + } + + # redirect /digitalocean/ to /do/ for any subpath + location /digitalocean/ { + rewrite ^/digitalocean/(.*)/$ /do/$1/ last; + rewrite ^/digitalocean/(.*)$ /do/$1 last; + } + + location ~ ^/[^/]+/$ { + try_files $uri /index.html; + autoindex off; + } + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + autoindex off; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +}