Skip to content
Snippets Groups Projects
Select Git revision
  • 4497521a9962b225f08231d26f06937836e73a20
  • master default protected
  • dev protected
  • replication_test
  • release-1.10 protected
  • release-1.9 protected
  • 551-init-broker-service-permissions
  • 549-test-oai-pmh
  • 545-saving-multiple-times-breaks-pid-metadata
  • 499-standalone-compute-service-2
  • 539-load-tests
  • hotfix/helm-chart
  • luca_ba_new_interface
  • 534-bug-when-adding-access-to-user-that-is-not-registered-at-dashboard-service
  • release-1.8 protected
  • 533-integrate-semantic-recommendation
  • feature/openshift
  • 518-spark-doesn-t-map-the-headers-correct
  • 485-fixity-checks
  • 530-various-schema-problems-with-subsets
  • release-1.7 protected
  • v1.10.2 protected
  • v1.10.1 protected
  • v1.10.0-rc13 protected
  • v1.10.0-rc12 protected
  • v1.10.0-rc11 protected
  • v1.10.0-rc10 protected
  • v1.10.0-rc9 protected
  • v1.10.0-rc8 protected
  • v1.10.0-rc7 protected
  • v1.10.0-rc6 protected
  • v1.10.0-rc5 protected
  • v1.10.0-rc4 protected
  • v1.10.0-rc3 protected
  • v1.10.0-rc2 protected
  • v1.10.0rc1 protected
  • v1.10.0rc0 protected
  • v1.10.0 protected
  • v1.9.3 protected
  • v1.9.2 protected
  • v1.9.2-rc0 protected
41 results

CONTRIBUTING.md

Blame
  • After you've reviewed these contribution guidelines, you'll be all set to contribute to this project.
    othes 2.99 KiB
    # Default server configuration
    #
    # server {
    #   listen 80;
    #   server_name netbox02.univie.ac.at;
    #   server_name gitlab02.phaidra.org;
    #   return 301 https://$server_name$request_uri;
    # }
    
    server {
      listen 80;
      listen 443 ssl http2;
    # server_name netbox02.univie.ac.at;
      server_name gitlab02.phaidra.org;
    
      root /var/www/html/netbox02;
      index index.html index.htm;
    
    # location / {
    #   try_files $uri $uri/ =404;
    # }
    
    # location /hello {
    #   content_by_lua '
    #     ngx.header["Content-Type"] = "text/html"
    #     ngx.say("hello world")
    #   ';
    # }
    
      location / {
        content_by_lua_block {
    
    local connect = function()
        local redis= require "nginx.redis"
        local red= redis:new()
        red:set_timeout(1000) -- 1 sec
        local ok, err = red:connect("127.0.0.1", 6379)
        if not ok then
            ngx.say(err)
            return ngx.exit(ngx.ERROR)
        end
    
        red:select(10) -- we use db10
        -- red:set('URXN10', 'BLA10')
     
        return red
    end
    
          local meth= ngx.req.get_method()
          -- ngx.header["Content-Type"] = "text/html"
          -- ngx.say("<h1>hello world</h1>")
          -- ngx.say("<p>meth=[", meth, "]</p>");
    
          if meth == "GET" or meth == "HEAD" then
            local uri= ngx.var.uri
            -- ngx.say("<p>uri=[", uri, "]</p>");
            local id, sep, rest
            for x1, x2, x3 in string.gmatch(uri, "/(%d+)(/?)(.*)") do
              id=   x1
              sep=  x2
              rest= x3
              break
            end
            -- ngx.say("<p>id=[", id, "] sep=[", sep, "] rest=[", rest, "]</p>");
    
            if id and tonumber(id) > 0 then
              -- ngx.say("<p>lookup redirect for id=[", id, "]</p>");
              local red= connect()
              local newurl, err= red:get(id)
    
              if type(newurl) == "string" then
                -- ngx.say("<p>newurl=[", newurl, "]</p>")
                ngx.redirect(newurl)
              else
                ngx.header["Content-Type"] = "text/html"
                ngx.say("<p>no redirection found (unkown id)</p>")
              end
            else
              ngx.header["Content-Type"] = "text/html"
              ngx.say("<p>no redirection found (unknown url)</p>")
            end
    
    --[[
            local args, err= ngx.req.get_uri_args()
            for key, val in pairs(args) do
               if type(val) == "table" then
                 ngx.say("<p>", key, ": ", table.concat(val, ", "), "</p>")
               else
                 ngx.say("<p>", key, ": ", val, "</p>")
               end
            end
    --]]
    
          else
            ngx.header["Content-Type"] = "text/html"
            ngx.say("<h1>sorry, can't help you</h1>")
          end
    
        }
      }
    
      ssl on;
    # ssl_certificate     /etc/ssl/certs/fullchain_netbox.univie.ac.at.crt;
    # ssl_certificate_key /etc/ssl/private/netbox.univie.ac.at.key;
      ssl_certificate     /etc/ssl/certs/fullchain_gitlab.phaidra.org.crt;
      ssl_certificate_key /etc/ssl/private/gitlab.phaidra.org.key;
      ssl_session_timeout 5m;
    	ssl_protocols       TLSv1.2 TLSv1.1 TLSv1; # Dropping SSLv3, ref: POODLE
      ssl_ciphers         'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
      ssl_prefer_server_ciphers on;
      ssl_session_cache shared:SSL:10m;
    
    }