Skip to main content

Nginx vhost

caution

Needs to be a full server { ... } config! A good starting point is often to copy the site.conf from your system.

Add or remove custom site.conf

It is recommended to use make upgrade, that includes the _config command for updating the link to an existing site.conf.

Examples

Imaginary

Related to docker-compose imaginary example

site.conf
map $qualityLevel $quality {
default false;
1 82;
2 65;
}

server {
...

location ~ ^/i/(?<qualityLevel>\d)/(?<width>\d+)/(?<height>\d+)/(?<image>.*) {
if ($quality = false) {
return 404;
}

proxy_pass http://imaginary:9001/crop?width=$width&height=$height&interlace=true&quality=$quality&file=media/$image;
proxy_set_header X-Real-IP $remote_addr;
}

...
}

server_push