Gitlab CSE Unil

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

## ------------
## Static paths
## ------------
Julien Furrer's avatar
Julien Furrer committed
6
    Alias /adim-dev/static/ "/var/django/projects/adim-dev.django/adim_project/static/"
7
    
Julien Furrer's avatar
Julien Furrer committed
8
    <Directory "/var/django/projects/adim-dev.django/adim_project/static">
9
        Options +FollowSymLinks -Indexes
10
11
12
13
14
15
16
		<IfVersion >= 2.4>
		    Require all granted
		</IfVersion>
		<IfVersion < 2.4>
       		Order deny,allow
        	Allow from all
		</IfVersion>
17
18
19
20
21
22
23
24
25
26
27
28
        <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
29
30
    Alias /adim-dev/media/ "/var/django/projects/adim-dev.django/adim_project/media/"
    <Directory "/var/django/projects/adim-dev.django/adim_project/media">
31
32
33
34
35
36
37
38
		<IfVersion >= 2.4>
		    Require all granted
		</IfVersion>
		<IfVersion < 2.4>
       		Order deny,allow
        	Allow from all
		</IfVersion>
		Options +FollowSymLinks +Indexes
39
40
41
42
43
    </Directory>

# ---------------
# Protected Media
# ---------------
Julien Furrer's avatar
Julien Furrer committed
44
    <Directory "/var/django/projects/adim-dev.django/adim_project/media/ao_images/">
45
46
47
48
49
50
51
        <IfVersion >= 2.4>
            Require all denied
        </IfVersion>
        <IfVersion < 2.4>
			Order allow,deny
			Deny from all
        </IfVersion>
52
    
53
54
55
56
57
        # --------------
        # XsendFile Conf
        # --------------
        <IfModule xsendfile_module>
            XSendFile On
Julien Furrer's avatar
Julien Furrer committed
58
            XSendFilePath "/var/django/projects/adim-dev.django/adim_project/media"
59
        </IfModule>
60
    
61
62
63
64
65
66
    </Directory>

# ---------------
# Shibboleth Conf
# ---------------
    <IfModule mod_shib>
Julien Furrer's avatar
Julien Furrer committed
67
        <Location /adim-dev/shibauth/>
68
            AuthType shibboleth
M. Chardon's avatar
min lib    
M. Chardon committed
69
			#ShibCompatWith24 On
70
71
			ShibRequestSetting requireSession true
			Require shibboleth
72
73
74
        </Location>
    </IfModule>

Julien Furrer's avatar
Julien Furrer committed
75
76
77
78
79
80
# ---------
# WSGI conf
# ---------

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

81
    WSGIScriptAlias /adim-dev  "/var/django/projects/adim-dev.django/adim_project/adim_project/wsgi/staging.py"
Julien Furrer's avatar
Julien Furrer committed
82
83
84
85
    <Directory "/var/django/projects/adim-dev.django/adim_project/adim_project">
        WSGIProcessGroup adim-dev.django
        WSGIPassAuthorization On
        <Files wsgi.py>
86
87
88
89
90
91
92
			<IfVersion >= 2.4>
				Require all granted
			</IfVersion>
			<IfVersion < 2.4>
				Order deny,allow
				Allow from all
			</IfVersion>
Julien Furrer's avatar
Julien Furrer committed
93
94
        </Files>
    </Directory>
95
    
Julien Furrer's avatar
Julien Furrer committed
96
    RedirectMatch ^/adim-dev$ /adim-dev/
97
    
98
99
100
101
102
    <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]
    </IfModule>
Julien Furrer's avatar
Julien Furrer committed
103

104
    <Location "/adim-dev/s-412-5/admin/">
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
        <IfModule rewrite_module>
            RewriteEngine On
            ## Retourne une 404 au lien d'une 403
            RewriteCond %{REMOTE_ADDR} !^130.223.72.159$
            RewriteRule ^.*$ - [R=404,L,NS]
        </IfModule>
        <IfModule !rewrite_module>
            <IfVersion >= 2.4>
                Require all denied
            </IfVersion>
            <IfVersion < 2.4>
                Order allow,deny
                Deny from all
            </IfVersion>
        </IfModule>
Julien Furrer's avatar
Julien Furrer committed
120
    </Location>
Julien Furrer's avatar
Julien Furrer committed
121

Julien Furrer's avatar
Julien Furrer committed
122
</IfModule>