To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

nginx.conf 1.08 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
server {
  listen         80 default_server;
  listen         [::]:80 default_server;
  server_name    _;
  root           /var/www/;
  index          index.html;

  access_log     /dev/stdout;
  error_log      /dev/stderr error;

  autoindex off;

  error_page 404 /en/404/index.html;

Sandro Lutz's avatar
Sandro Lutz committed
15
  sendfile on;
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
  gzip_static on;

  location = /sw.js {
    # Do not allow caching of service worker.
    add_header Cache-Control "no-cache";
  }

  location ~* /(en|de)/404/index.html {
    internal;
  }

  location ~* \.html$ {
    add_header Cache-Control "no-cache";
    expires    off;
  }

  location ~* \.(ico|jpg|jpeg|png|gif|svg|js|jsx|css|less|swf|eot|ttf|otf|woff|woff2)$ {
    add_header Cache-Control "public";
    expires +1y;
  }

Sandro Lutz's avatar
Sandro Lutz committed
37
38
39
40
41
  location ~* ^/(en|de)/(events|studydocuments|jobs)/([a-z0-9]+)$ {
    error_page 404 /$1/404/index.html;
    try_files $uri /$1/$2/index.html =404;
  }

42
43
44
45
46
47
48
49
50
51
  location ~* ^/(en|de)/ {
    error_page 404 /$1/404/index.html;
    try_files $uri $uri/index.html =404;
  }

  location / {
    error_page 404 /en/404/index.html;
    try_files $uri $uri/index.html =404;
  }
}