|
2147
|
1 local luanhostDir = ...
|
|
|
2
|
|
|
3 %>
|
|
|
4 # IMPORTANT:
|
|
|
5 # directives outside `server` blocks are applied directly to the
|
|
|
6 # `http` block that this file is `include`d in. all these directives
|
|
|
7 # will apply to luanhost *AND* everything `include`d after it.
|
|
|
8 # this file name is preceded with `9990` so the glob expansion
|
|
|
9 # loads it towards the end of the list.
|
|
|
10
|
|
|
11 proxy_cache_path /usr/local/nginx_cache levels=1:2 keys_zone=nginx_cache:60m max_size=10g inactive=60m use_temp_path=off;
|
|
|
12 error_log <%=luanhostDir%>/logs/nginx_error.log warn;
|
|
|
13
|
|
|
14 server {
|
|
|
15 # ensure no other default_server exists!
|
|
|
16 # nginx usually has one at /etc/nginx/sites-enabled/default
|
|
|
17 listen 80 default_server;
|
|
|
18 listen [::]:80 default_server;
|
|
|
19 # DON'T put this in the auto-loaded configs dir,
|
|
|
20 # it is not meant to be loaded on its own.
|
|
|
21 include <%=luanhostDir%>/local/luanhost_default_site.conf;
|
|
|
22
|
|
|
23 location /.well-known/acme-challenge/ {
|
|
|
24 # $host/ssl does not exist for non-ssl sites and requests to here
|
|
|
25 # will fail with 404 for those sites, which is what we want
|
|
|
26 alias <%=luanhostDir%>/sites/$host/ssl/acme-challenge/;
|
|
|
27 try_files $uri $uri/ =404;
|
|
|
28 }
|
|
|
29 }
|
|
|
30
|
|
|
31 # glob pattern returns no results for site dirs that don't have
|
|
|
32 # the ssl/ subdir, so this is ok
|
|
|
33 include <%=luanhostDir%>/sites/*/ssl/nginx.ssl.conf;
|
|
|
34 <%
|