IL-2602

Форк
0
/
nginx.conf 
59 строк · 1.7 Кб
1
server {
2

3
  listen        3263;
4
  server_name   localhost;
5
  access_log    /var/log/nginx/host.access.log;
6
  error_log /var/log/nginx/host.error.log;
7

8
  root   /usr/share/nginx/html;
9
  index  index.html index.htm;
10

11
  location ~ .*remoteEntry.js$ {
12
      expires -1;
13
      add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
14
  }
15

16
  location ~* \.(?:manifest|appcache|html?|xml|json)$ {
17
     expires -1;
18
   }
19

20
  location ~* \.(?:css|js)$ {
21
     try_files $uri =404;
22
     expires 1y;
23
     access_log off;
24
     add_header Cache-Control "public";
25
   }
26

27
  # Any route containing a file extension (e.g. /devicesfile.js)
28
  location ~ ^.+\..+$ {
29
    try_files $uri  =404;
30
  }
31

32
  location / {
33
      root /usr/share/nginx/html;
34
      index index.html;
35
      autoindex on;
36
      set $fallback_file /index.html;
37
      if ($http_accept !~ text/html) {
38
          set $fallback_file /null;
39
      }
40
#       if ($uri ~ /$) {
41
#           set $fallback_file /null;
42
#       }
43
      try_files $uri $fallback_file;
44

45
      if ($request_method = 'OPTIONS') {
46
          add_header 'Access-Control-Allow-Origin: $http_origin');
47
          add_header 'Access-Control-Allow-Origin: GET, POST, DELETE, PUT, PATCH, OPTIONS');
48
          add_header 'Access-Control-Allow-Credentials: true');
49
          add_header 'Vary: Origin');
50

51
      }
52

53
       add_header 'Access-Control-Allow-Origin' "$http_origin" always;
54
       add_header 'Access-Control-Allow-Credentials' 'true' always;
55
       add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, DELETE, OPTIONS' always;
56
       add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
57

58
  }
59
}
60

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.