Projet

Général

Profil

0001-nginx-example.conf-redirect-non-ssl-requests.patch

Christophe Siraut, 23 mars 2018 18:27

Télécharger (1,31 ko)

Voir les différences:

Subject: [PATCH 1/4] nginx-example.conf: redirect non-ssl requests

 debian/nginx-example.conf | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
debian/nginx-example.conf
38 38
        access_log  /var/log/nginx/combo.example.org-access.log combined;
39 39
        error_log  /var/log/nginx/combo.example.org-error.log;
40 40

  
41
        location ~ ^/static/(.+)$ {
42
            root /;
43
            try_files /var/lib/combo/tenants/$host/static/$1
44
                      /var/lib/combo/collectstatic/$1
45
                      =404;
46
        }
47

  
48
        location ~ ^/media/(.+)$ {
49
            alias /var/lib/combo/tenants/$host/media/$1;
50
        }
51

  
52
        location / {
53
            proxy_pass         http://unix:/var/run/combo/combo.sock;
54
            proxy_set_header   Host $http_host;
55
            proxy_set_header   X-Real-IP       $remote_addr;
56
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
57
        }
41
        return 302 https://$host$request_uri;
58 42
}
59
-