34 lines
929 B
Plaintext
34 lines
929 B
Plaintext
proxy_cache_path /tmp/nginx-cache levels=1:2 keys_zone=qrcode_cache:10m max_size=50m inactive=60m;
|
|
|
|
server {
|
|
listen 80 default_server;
|
|
server_name vending.waw.hackerspace.pl;
|
|
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:5000;
|
|
}
|
|
|
|
location /qrcode/ {
|
|
add_header X-Proxy-Cache $upstream_cache_status;
|
|
proxy_cache qrcode_cache;
|
|
proxy_pass http://127.0.0.1:5000;
|
|
}
|
|
|
|
location /static/ {
|
|
root /var/bitvend/bitvend;
|
|
}
|
|
|
|
listen 443 ssl default_server;
|
|
|
|
ssl_certificate /var/lib/dehydrated/certs/vending.waw.hackerspace.pl/fullchain.pem;
|
|
ssl_certificate_key /var/lib/dehydrated/certs/vending.waw.hackerspace.pl/privkey.pem;
|
|
|
|
if ($scheme = http) {
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
}
|