lemonldap-ng/e2e-tests/test-nginx.conf
2017-02-16 17:22:08 +00:00

52 lines
1.4 KiB
Plaintext

server {
listen __port__;
server_name test1.example.com test2.example.com;
root __pwd__/e2e-tests/conf/site;
# Internal authentication request
location = /lmauth {
internal;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:__pwd__/e2e-tests/conf/llng-fastcgi.sock;
# 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 / {
index index.pl;
try_files $uri $uri/ =404;
auth_request /lmauth;
auth_request_set $lmremote_user $upstream_http_lm_remote_user;
auth_request_set $lmlocation $upstream_http_location;
error_page 401 $lmlocation;
include conf/nginx-lua-headers.conf;
}
# Handle test CGI
location ~ \.pl$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:__pwd__/e2e-tests/conf/llng-fastcgi.sock;
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;
}
location = /status {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:__pwd__/e2e-tests/conf/llng-fastcgi.sock;
fastcgi_param LLTYPE status;
}
}