annotate host/startup/nginx/nginx.conf.luan @ 2134:de3107eb911f

improve previous
author Violet7
date Fri, 16 Jan 2026 17:59:40 -0800
parents c3b4c19f2d8a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2133
c3b4c19f2d8a attempt to autodetect and use nginx confs dir
Violet7
parents: 2129
diff changeset
1 local luanhostDir, nginxConfigDir, user, group = ...
1632
0344a535b1db add doc
fffilimonov
parents:
diff changeset
2
0344a535b1db add doc
fffilimonov
parents:
diff changeset
3 %>
2129
6a2383baecb6 integrate into system nginx
Violet7
parents: 2126
diff changeset
4 proxy_cache_path /usr/local/nginx_cache levels=1:2 keys_zone=nginx_cache:60m max_size=10g inactive=60m use_temp_path=off;
1632
0344a535b1db add doc
fffilimonov
parents:
diff changeset
5 server {
2129
6a2383baecb6 integrate into system nginx
Violet7
parents: 2126
diff changeset
6 # ensure no other default_server exists!
6a2383baecb6 integrate into system nginx
Violet7
parents: 2126
diff changeset
7 # nginx usually has one at /etc/nginx/sites-enabled/default
1632
0344a535b1db add doc
fffilimonov
parents:
diff changeset
8 listen 80 default_server;
1776
da85925fea9c listen ipv6
Vadim Filimonov <fffilimonov@yandex.ru>
parents: 1725
diff changeset
9 listen [::]:80 default_server;
2134
de3107eb911f improve previous
Violet7
parents: 2133
diff changeset
10 # DON'T put this in the auto-loaded configs dir,
de3107eb911f improve previous
Violet7
parents: 2133
diff changeset
11 # it is not meant to be loaded on its own.
de3107eb911f improve previous
Violet7
parents: 2133
diff changeset
12 include <%=luanhostDir%>/local/luanhost.default.conf;
2085
c35179c79298 alias <%=rootDir%>/sites/$host/acme-challenge/
Franklin Schmidt <fschmidt@gmail.com>
parents: 2083
diff changeset
13
c35179c79298 alias <%=rootDir%>/sites/$host/acme-challenge/
Franklin Schmidt <fschmidt@gmail.com>
parents: 2083
diff changeset
14 location /.well-known/acme-challenge/ {
2117
1e247cd012ee use site_dir/ssl for all ssl related files; raise error() on empty acme-tiny output.
Violet7
parents: 2098
diff changeset
15 # $host/ssl does not exist for non-ssl sites and requests to here
1e247cd012ee use site_dir/ssl for all ssl related files; raise error() on empty acme-tiny output.
Violet7
parents: 2098
diff changeset
16 # will fail with 404 for those sites, which is what we want
2133
c3b4c19f2d8a attempt to autodetect and use nginx confs dir
Violet7
parents: 2129
diff changeset
17 alias <%=luanhostDir%>/sites/$host/ssl/acme-challenge/;
2126
c9b474306066 add previous fix to the default http block
Violet7
parents: 2117
diff changeset
18 try_files $uri $uri/ =404;
2085
c35179c79298 alias <%=rootDir%>/sites/$host/acme-challenge/
Franklin Schmidt <fschmidt@gmail.com>
parents: 2083
diff changeset
19 }
1632
0344a535b1db add doc
fffilimonov
parents:
diff changeset
20 }
0344a535b1db add doc
fffilimonov
parents:
diff changeset
21
2117
1e247cd012ee use site_dir/ssl for all ssl related files; raise error() on empty acme-tiny output.
Violet7
parents: 2098
diff changeset
22 # glob pattern returns no results for site dirs that don't have
1e247cd012ee use site_dir/ssl for all ssl related files; raise error() on empty acme-tiny output.
Violet7
parents: 2098
diff changeset
23 # the ssl/ subdir, so this is ok
2133
c3b4c19f2d8a attempt to autodetect and use nginx confs dir
Violet7
parents: 2129
diff changeset
24 include <%=luanhostDir%>/sites/*/ssl/nginx.ssl.conf;
1632
0344a535b1db add doc
fffilimonov
parents:
diff changeset
25 <%