Add nginx proxy hosts for Garage Web access

The respective bucket needs to be configured with a domain alias. When a
new alias is added to the `s3_web_domains` config, a new nginx site can
then be deployed to the `nginx_proxy` hosts.
This commit is contained in:
Râu Cao
2022-11-30 12:13:39 +01:00
parent 3641ea7a60
commit b738dc1e80
4 changed files with 66 additions and 3 deletions

View File

@@ -0,0 +1,33 @@
upstream garage_web {
server localhost:3902;
}
proxy_cache_path /var/cache/nginx/garage levels=1:2 keys_zone=garage_cache:10m
max_size=1g inactive=60m use_temp_path=off;
server {
listen 443 http2 ssl;
listen [::]:443 http2 ssl;
server_name <%= @server_name %>;
access_log off;
ssl_certificate <%= @ssl_cert %>;
ssl_certificate_key <%= @ssl_key %>;
error_page 401 403 404 500 /__empty-page.html;
location = /__empty-page.html {
internal;
return 200 "";
}
location / {
proxy_intercept_errors on;
proxy_cache garage_cache;
proxy_pass http://garage_web;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
}