Projet

Général

Profil

Télécharger (2,02 ko) Statistiques
| Branche: | Tag: | Révision:

root / debian / share / nginx-example.conf @ 80300379

1
server {
2
        listen   443;
3
        server_name  u-auth.example.org;
4

    
5
        ssl                  on;
6
        ssl_certificate      /etc/ssl/certs/ssl-cert-snakeoil.pem;
7
        ssl_certificate_key  /etc/ssl/private/ssl-cert-snakeoil.key;
8

    
9
        access_log  /var/log/nginx/u-auth.example.org-access.log combined;
10
        error_log  /var/log/nginx/u-auth.example.org-error.log;
11

    
12
        location ~ ^/static/([^/]+)/(.+)$ {
13
            root /;
14
            try_files /var/lib/u-auth/organizations/$1/static/$2
15
                      /var/lib/u-auth/static/$1/$2
16
                      /var/lib/u-auth/collectstatic/$1/$2
17
                      =404;
18
        }
19

    
20

    
21
        location ~ ^/media/(.+)$ {
22
            alias /var/lib/u-auth/media/$1;
23
        }
24

    
25
        location / {
26
            proxy_pass         http://unix:/var/run/u-auth/u-auth.sock;
27
            proxy_set_header   Host $http_host;
28
            proxy_set_header   X-Forwarded-SSL on;
29
            proxy_set_header   X-Forwarded-Protocol ssl;
30
            proxy_set_header   X-Forwarded-Proto https;
31
            proxy_set_header   X-Real-IP       $remote_addr;
32
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
33
        }
34
}
35

    
36
server {
37
        listen   80;
38
        server_name  u-auth.example.org;
39

    
40
        access_log  /var/log/nginx/u-auth.example.org-access.log combined;
41
        error_log  /var/log/nginx/u-auth.example.org-error.log;
42

    
43
        location ~ ^/static/([^/]+)/(.+)$ {
44
            root /;
45
            try_files /var/lib/u-auth/organizations/$1/static/$2
46
                      /var/lib/u-auth/static/$1/$2
47
                      /var/lib/u-auth/collectstatic/$1/$2
48
                      =404;
49
        }
50

    
51
        location ~ ^/media/(.+)$ {
52
            alias /var/lib/u-auth/media/$1;
53
        }
54

    
55
        location / {
56
            proxy_pass         http://unix:/var/run/u-auth/u-auth.sock;
57
            proxy_set_header   Host $http_host;
58
            proxy_set_header   X-Real-IP       $remote_addr;
59
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
60
        }
61
}
(2-2/6)