Gitlab CSE Unil

staging.conf 2.66 KB
Newer Older
1
2
3
4
5
<IfModule wsgi_module>

## ------------
## Static paths
## ------------
Julien Furrer's avatar
Julien Furrer committed
6
7
8
    Alias /adim-dev/static/ "/var/django/projects/adim-dev.django/adim_project/static/"

    <Directory "/var/django/projects/adim-dev.django/adim_project/static">
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
        Options +FollowSymLinks -Indexes
        Order deny,allow
        Allow from all
        <IfModule expires_module>
            ExpiresActive On
            ExpiresDefault "access plus 10 minutes"
            <IfModule headers_module>
                Header append Cache-Control "public"
            </IfModule>
        </IfModule>
    </Directory>

# ----------
# Media path
# ----------
Julien Furrer's avatar
Julien Furrer committed
24
25
    Alias /adim-dev/media/ "/var/django/projects/adim-dev.django/adim_project/media/"
    <Directory "/var/django/projects/adim-dev.django/adim_project/media">
26
27
28
29
30
31
32
33
        Options +FollowSymLinks -Indexes
        Order deny,allow
        Allow from all
    </Directory>

# ---------------
# Protected Media
# ---------------
Julien Furrer's avatar
Julien Furrer committed
34
    <Directory "/var/django/projects/adim-dev.django/adim_project/media/ao_images/">
35
36
        Order allow,deny
        Deny from all
Julien Furrer's avatar
Julien Furrer committed
37

38
39
40
41
42
        # --------------
        # XsendFile Conf
        # --------------
        <IfModule xsendfile_module>
            XSendFile On
Julien Furrer's avatar
Julien Furrer committed
43
            XSendFilePath "/var/django/projects/adim-dev.django/adim_project/media"
44
        </IfModule>
Julien Furrer's avatar
Julien Furrer committed
45

46
47
48
49
50
51
    </Directory>

# ---------------
# Shibboleth Conf
# ---------------
    <IfModule mod_shib>
Julien Furrer's avatar
Julien Furrer committed
52
        <Location /adim-dev/shibauth/>
53
54
55
56
57
58
59
60
61
62
63
            #Order allow,deny
            #Allow from all
            AuthType shibboleth
            ShibRequireSession On
            ShibRedirectToSSL 443
            require uniqueID impossiblevaluehere@nowhere.org

            require valid-user
        </Location>
    </IfModule>

Julien Furrer's avatar
Julien Furrer committed
64
65
66
67
68
69
# ---------
# WSGI conf
# ---------

    WSGIDaemonProcess adim-dev.django user=www-data group=www-data

70
    WSGIScriptAlias /adim-dev  "/var/django/projects/adim-dev.django/adim_project/adim_project/wsgi/staging.py"
Julien Furrer's avatar
Julien Furrer committed
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
    <Directory "/var/django/projects/adim-dev.django/adim_project/adim_project">
        WSGIProcessGroup adim-dev.django
        WSGIPassAuthorization On
        <Files wsgi.py>
            Order deny,allow
            Allow from all
        </Files>
    </Directory>

    RedirectMatch ^/adim-dev$ /adim-dev/

    <Location "/adim-dev/">
        <IfModule rewrite_module>
            RewriteEngine On
            ## Retourne une 404 pour media/protected au lien d'une 403
            RewriteRule ^/adim-dev/media//ao_images/.*$ - [R=404,L,NS]

            #RewriteCond %{REMOTE_ADDR} !^130.223.3.229$
            #RewriteCond %{REQUEST_URI} !^/static/.*$
            #RewriteRule ^.*$ /maintenance.html
        </IfModule>
    </Location>

94
</IfModule>
Julien Furrer's avatar
Julien Furrer committed
95