2021-02-10 22:56:05 +01:00
|
|
|
# cache
|
|
|
|
proxy_cache_path /tmp levels=1:2 keys_zone=STATIC:10m inactive=24h max_size=10g use_temp_path=off;
|
2020-11-21 23:42:08 +01:00
|
|
|
|
2021-02-10 22:56:05 +01:00
|
|
|
{% if with_certbot -%}
|
|
|
|
# redirect all http traffic to https
|
|
|
|
server {
|
|
|
|
listen 80 default_server;
|
|
|
|
listen [::]:80 default_server;
|
|
|
|
server_name _;
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
}
|
|
|
|
{%- endif %}
|
2020-11-21 23:42:08 +01:00
|
|
|
|
2021-02-10 22:56:05 +01:00
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
listen [::]:80;
|
|
|
|
server_name _server_name;
|
|
|
|
root /var/www/html;
|
|
|
|
}
|
2020-11-21 23:42:08 +01:00
|
|
|
|
2021-02-10 22:56:05 +01:00
|
|
|
# enable proxy websocket
|
|
|
|
map $http_upgrade $connection_upgrade {
|
|
|
|
default upgrade;
|
|
|
|
'' close;
|
|
|
|
}
|
2020-11-21 23:42:08 +01:00
|
|
|
|