Files
Reverse_proxy_Nginx/template/https.conf
T
2024-07-22 10:04:17 +01:00

47 lines
1.3 KiB
Plaintext

upstream example_backend {
server 192.168.88.52:9080;
server 1.1.1.1 backup;
}
server {
server_name example.tryton.geeraert.eu www.example.tryton.geeraert.eu;
location / {
proxy_pass http://example_backend;
location ~* \.(html|css|jpg|gif|ico|js)$ {
proxy_cache cache;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_valid 200 301 302 30m;
expires 30m;
proxy_pass http://nextcloud_backend;
}
}
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/nginx/ssl/live/tryton.geeraert.eu/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/live/tryton.geeraert.eu/privkey.pem;
}
server {
if ($host = www.example.tryton.geeraert.eu) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = example.tryton.geeraert.eu) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name www.example.tryton.geeraert.eu example.tryton.geeraert.eu;
listen 80;
return 404; # managed by Certbot
}