comparison host/startup/nginx/nginx.conf.luan @ 2129:6a2383baecb6

integrate into system nginx
author Violet7
date Fri, 16 Jan 2026 15:30:49 -0800
parents c9b474306066
children c3b4c19f2d8a
comparison
equal deleted inserted replaced
2128:cfe173c8e104 2129:6a2383baecb6
1 local rootDir, user, group = ... 1 local rootDir, user, group = ...
2 2
3 %> 3 %>
4 worker_processes 4; 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;
5 user <%=user%> <%=group%>;
6 pid /var/run/luanhost_nginx.pid;
7
8 events {
9 worker_connections 4096;
10 }
11
12 http {
13 include mime.types;
14 default_type application/octet-stream;
15 sendfile on;
16 keepalive_timeout 65;
17
18 proxy_cache_path <%=rootDir%>/local/nginx_cache levels=1:2 keys_zone=nginx_cache:60m max_size=10g inactive=60m use_temp_path=off;
19
20 upstream luan {
21 server 127.0.0.1:8080;
22 }
23
24 server { 5 server {
6 # ensure no other default_server exists!
7 # nginx usually has one at /etc/nginx/sites-enabled/default
25 listen 80 default_server; 8 listen 80 default_server;
26 listen [::]:80 default_server; 9 listen [::]:80 default_server;
27 include nginx.default.conf; 10 include <%=rootDir%>/local/nginx.default.conf;
28 11
29 location /.well-known/acme-challenge/ { 12 location /.well-known/acme-challenge/ {
30 # $host/ssl does not exist for non-ssl sites and requests to here 13 # $host/ssl does not exist for non-ssl sites and requests to here
31 # will fail with 404 for those sites, which is what we want 14 # will fail with 404 for those sites, which is what we want
32 alias <%=rootDir%>/sites/$host/ssl/acme-challenge/; 15 alias <%=rootDir%>/sites/$host/ssl/acme-challenge/;
35 } 18 }
36 19
37 # glob pattern returns no results for site dirs that don't have 20 # glob pattern returns no results for site dirs that don't have
38 # the ssl/ subdir, so this is ok 21 # the ssl/ subdir, so this is ok
39 include <%=rootDir%>/sites/*/ssl/nginx.ssl.conf; 22 include <%=rootDir%>/sites/*/ssl/nginx.ssl.conf;
40 }
41 <% 23 <%