Add nginx-reverse-proxy Software Release.
[slapos.git] / slapos / recipe / reverse_proxy_nginx / template / nginx.conf.in
1 daemon off;
2 worker_processes 1;
3
4 #XXX-Cedric: TODO separate the different logs
5 error_log %(error-log)s info;
6
7 events {
8         worker_connections 1024;
9         use epoll;
10 }
11
12 http {
13         log_format main
14                 '$remote_addr - $remote_user [$time_local] '
15                 '"$request" $status $bytes_sent '
16                 '"$http_referer" "$http_user_agent" '
17                 '"$gzip_ratio"';
18
19         server {
20                 listen %(listen-local-ipv4)s:8008;
21                 server_name localhost;
22                 access_log %(access-log)s main;
23                 error_log %(error-log)s info;
24
25                 root %(htdocs)s;
26
27                 location ~ $ {
28                         add_header Auth-Server %(smtp-upstream-host)s;
29                         add_header Auth-Port %(smtp-upstream-port)s;
30                         return 200;
31                 }
32         }
33 }
34
35 mail {
36         server_name %(domain-name)s;
37
38         auth_http %(listen-local-ipv4)s:8008;
39
40         server {
41                 listen %(listen-local-ipv4)s:%(smtp-port-number)s;
42                 listen %(listen-global-ipv6)s:%(smtp-port-number)s;
43                 protocol smtp;
44                 timeout 5s;
45                 proxy on;
46                 xclient off;
47                 smtp_auth none;
48         }
49 }