test-nginx.conf 1.96 KB
Newer Older
1 2
server {
  listen __port__;
3
  server_name test1.example.com test2.example.com;
4 5 6 7 8 9
  root __pwd__/e2e-tests/conf/site;

  # Internal authentication request
  location = /lmauth {
    internal;
    include /etc/nginx/fastcgi_params;
10
    fastcgi_pass unix:__pwd__/e2e-tests/conf/llng-fastcgi.sock;
Xavier Guimard's avatar
Xavier Guimard committed
11
    #fastcgi_pass 127.0.0.1:9090;
12 13
    #fastcgi_param RULES_URL "http://test2.example.com:__port__/test.json";
    #fastcgi_param VHOSTTYPE "DevOps";
14 15 16 17 18 19 20 21 22 23

    # Drop post datas
    fastcgi_pass_request_body  off;
    fastcgi_param CONTENT_LENGTH "";

    # Keep original hostname
    fastcgi_param HOST $http_host;

    # Keep original request (LLNG server will received /llauth)
    fastcgi_param X_ORIGINAL_URI  $request_uri;
24 25 26 27 28 29 30 31

    # OU TO USE uWSGI
    #include /etc/nginx/uwsgi_params;
    #uwsgi_pass 127.0.0.1:5000;
    #uwsgi_pass_request_body  off;
    #uwsgi_param CONTENT_LENGTH "";
    #uwsgi_param HOST $http_host;
    #uwsgi_param X_ORIGINAL_URI  $request_uri;
32 33 34
  }

  # Client requests
35 36
  location / {
    index index.pl;
37
    try_files $uri $uri/ =404;
38 39 40 41
    auth_request /lmauth;
    auth_request_set $lmremote_user $upstream_http_lm_remote_user;
    auth_request_set $lmlocation $upstream_http_location;
    error_page 401 $lmlocation;
42 43
    include conf/nginx-lua-headers.conf;
  }
44

45 46 47 48 49 50
  location /test.json {
    auth_request off;
    allow 127.0.0.0/8;
    deny all;
  }

51 52 53 54 55 56
  location /rules.json {
    auth_request off;
    allow 127.0.0.0/8;
    deny all;
  }

57 58
  # Handle test CGI
  location ~ \.pl$ {
59
    include /etc/nginx/fastcgi_params;
60
    fastcgi_pass unix:__pwd__/e2e-tests/conf/llng-fastcgi.sock;
61 62 63 64 65 66
    fastcgi_param LLTYPE cgi;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_split_path_info ^(.*\.pl)(/.+)$;
    # Set REMOTE_USER (for FastCGI apps only)
    fastcgi_param REMOTE_USER $lmremote_user;
  }
67

68
  location = /status {
69
    include /etc/nginx/fastcgi_params;
70
    fastcgi_pass unix:__pwd__/e2e-tests/conf/llng-fastcgi.sock;
71
    fastcgi_param LLTYPE status;
72 73 74
  }

}