Personal wiki for common problems.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

379 B

nginx hacks and snippets

Remove .html and rewrite urls

server {
		listen 80;
		listen [::]:80;
		root <root_dir>;
		index index.html index.htm;

		server_name <server_name>;

		# rewrites .html to pretty urls
		rewrite ^(/.+)\.html$ $scheme://$host$1 permanent;

		location / {
				index index.html index.htm;
				try_files $uri.html $uri $uri/ @handler;
		}
}