Instantly share code, notes, and snippets.

@mockra /nginx
Last active Sep 25, 2018

What would you like to do?
nginx config for static site
server {
listen 80;
root /var/www/;
index index.html index.htm;
location / {
default_type "text/html";
try_files $uri.html $uri $uri/ /index.html;

This comment has been minimized.

gogotanaka commented Aug 17, 2014

I really appreciate your documents!(

Thank you!


This comment has been minimized.

andriyfm commented Mar 7, 2018



This comment has been minimized.

dumptyd commented Jul 7, 2018

try_files $uri.html $uri $uri/ /index.html; should be changed to try_files $uri.html $uri $uri/ =404; imo, otherwise it will render index.html for any route you visit on the site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment