Mercurial Hosting > luan
diff host/startup/nginx/nginx.default.conf.luan @ 1632:0344a535b1db
add doc
author | fffilimonov |
---|---|
date | Tue, 14 Dec 2021 07:41:01 +0000 |
parents | |
children | d778f1f2598a |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/host/startup/nginx/nginx.default.conf.luan Tue Dec 14 07:41:01 2021 +0000 @@ -0,0 +1,31 @@ +local rootDir, leKey = ... + +%> + client_max_body_size 32m; + + proxy_http_version 1.1; + proxy_set_header Host $http_host; + error_log <%=rootDir%>/logs/nginx_error.log; + + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Real-IP $remote_addr; + + charset utf-8; + + location ~ "^/\.well-known/acme-challenge/([-_a-zA-Z0-9]+)$" { + default_type text/plain; + return 200 "$1.<%=leKey%>"; + } + + location ~ /(?<path>.*) { + proxy_cache_key $scheme$host$request_uri; + proxy_cache nginx_cache; + proxy_cache_revalidate on; + proxy_cache_min_uses 1; + proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; + proxy_cache_background_update on; + proxy_cache_lock on; + add_header X-Cache-Status $upstream_cache_status; + proxy_pass http://luan; + } +<%