Skip to content

Instantly share code, notes, and snippets.

@mkorkmaz
Created October 31, 2018 14:59
Show Gist options
  • Save mkorkmaz/4549975de096220071ec3ffe9b142f4f to your computer and use it in GitHub Desktop.
Save mkorkmaz/4549975de096220071ec3ffe9b142f4f to your computer and use it in GitHub Desktop.
server {
listen 80;
listen [::]:80;
root /var/lib/www;
server_name _;
server_tokens off;
more_clear_headers Server;
add_header Server "selami/image-server";
location / {
rewrite /images/(.*):(\w+)$ /cdn/images/$2/$1 last;
try_files $uri $uri/ 404;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment