portal-nginx.conf 1.52 KB
Newer Older
Yadd's avatar
Yadd committed
1 2 3 4 5
server {
  listen __PORT__;
  server_name auth.__DNSDOMAIN__;
  root __PORTALDIR__;

Yadd's avatar
Yadd committed
6 7 8 9 10
  if ($uri !~ ^/((static|javascript|favicon).*|.*\.psgi)) {
    rewrite ^/(.*)$ /index.psgi/$1 break;
  }

  location ~ \.psgi(?:$|/) {
Yadd's avatar
Yadd committed
11
    include /etc/nginx/fastcgi_params;
Yadd's avatar
Yadd committed
12
    fastcgi_pass unix:__FASTCGISOCKDIR__/llng-fastcgi.sock;
Yadd's avatar
Yadd committed
13
    fastcgi_param LLTYPE psgi;
14
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
Yadd's avatar
Yadd committed
15 16
    set $sn $document_uri;
    if ($sn ~ "^(.*\.psgi).*") {
Yadd's avatar
Yadd committed
17 18 19
        set $sn $1;
    }
    fastcgi_param SCRIPT_NAME $sn;
Yadd's avatar
Yadd committed
20
    fastcgi_param SCRIPT_FILENAME $document_root$sn;
Yadd's avatar
Yadd committed
21
    fastcgi_split_path_info ^(.*\.psgi)(/.+)$;
Yadd's avatar
Yadd committed
22
    fastcgi_param PATH_INFO  $fastcgi_path_info;
Yadd's avatar
Yadd committed
23 24
  }

Yadd's avatar
Yadd committed
25
  index index.psgi;
Yadd's avatar
Yadd committed
26
  location / {
Yadd's avatar
Yadd committed
27 28 29 30
    try_files $uri $uri/ =404;

    # Uncomment this if you use https only
    #add_header Strict-Transport-Security "15768000";
Yadd's avatar
Yadd committed
31
  }
Yadd's avatar
Yadd committed
32

Yadd's avatar
Yadd committed
33 34 35 36
  location /static/ {
    alias __PORTALSTATICDIR__;
  }

Yadd's avatar
Yadd committed
37 38 39 40 41 42
  # SOAP functions for sessions management (disabled by default)
  location /index/adminSessions {
    deny all;
  }

  # SOAP functions for sessions access (disabled by default)
Yadd's avatar
Yadd committed
43
  location /index.psgi/sessions {
Yadd's avatar
Yadd committed
44 45 46 47
    deny all;
  }

  # SOAP functions for configuration access (disabled by default)
Yadd's avatar
Yadd committed
48
  location /index.psgi/config {
Yadd's avatar
Yadd committed
49 50 51 52
    deny all;
  }

  # SOAP functions for notification insertion (disabled by default)
Yadd's avatar
Yadd committed
53
  location /index.psgi/notification {
Yadd's avatar
Yadd committed
54 55
    deny all;
  }
56

Yadd's avatar
Yadd committed
57 58 59 60 61
  # DEBIAN
  # If install was made with USEDEBIANLIBS (official releases), uncomment this
  #location /javascript/ {
  #  alias /usr/share/javascript/;
  #}
Yadd's avatar
Yadd committed
62
}