test-nginx.conf 1.47 KB
Newer Older
Xavier Guimard's avatar
Xavier Guimard committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
server {
  listen __PORT__;
  server_name test1.__DNSDOMAIN__;
  root /var/www/html;


  # Internal authentication request
  location = /lmauth {
    internal;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass __PSGISERVERSOCKET__;

    # 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;
  }

  # Client requests
  location / {
    auth_request /lmauth;
    auth_request_set $lmremote_user $upstream_http_lm_remote_user;
    auth_request_set $lmlocation $upstream_http_location;
    error_page 401 $lmlocation;
    try_files $uri $uri/ =404;

32 33 34
    ##################################
    # PASSING HEADERS TO APPLICATION #
    ##################################
Xavier Guimard's avatar
Xavier Guimard committed
35

36 37
    # IF LUA IS SUPPORTED
    #include /path/to/nginx-lua-headers.conf
Xavier Guimard's avatar
Xavier Guimard committed
38

39 40 41 42
    # ELSE
    # Set manually your headers
    #auth_request_set $authuser $upstream_http_auth_user;
    #proxy_set_header Auth-User $authuser;
Xavier Guimard's avatar
Xavier Guimard committed
43
    # OR
44
    #fastcgi_param HTTP_AUTH_USER $authuser;
Xavier Guimard's avatar
Xavier Guimard committed
45

46 47
    # Uncomment this if you use https only
    #add_header Strict-Transport-Security "15768000";
Xavier Guimard's avatar
Xavier Guimard committed
48 49 50

  }

51 52 53 54 55
  #location = /lmstatus {
  #  allow 127.0.0.1;
  #  deny all;
  #  include /etc/nginx/fastcgi_params;
  #  fastcgi_pass __PSGISERVERSOCKET__;
56
  #  fastcgi_pass unix:__FASTCGISOCKDIR__/llng-fastcgi.sock;
57 58
  #  fastcgi_param LLTYPE status;
  #}
Xavier Guimard's avatar
Xavier Guimard committed
59
}