lemonldap-ng/e2e-tests/test-nginx.conf

75 lines
2.0 KiB
Plaintext
Raw Normal View History

server {
listen __port__;
2016-02-16 17:00:45 +01:00
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;
2016-02-16 17:00:45 +01:00
fastcgi_pass unix:__pwd__/e2e-tests/conf/llng-fastcgi.sock;
2018-04-22 16:08:34 +02:00
#fastcgi_pass 127.0.0.1:9090;
2018-05-13 15:13:45 +02:00
#fastcgi_param RULES_URL "http://test2.example.com:__port__/test.json";
#fastcgi_param VHOSTTYPE "DevOps";
# 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;
2018-03-26 10:15:37 +02:00
# 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;
}
# Client requests
location / {
index index.pl;
2017-02-16 18:22:08 +01:00
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;
}
2018-05-13 15:13:45 +02:00
location /test.json {
auth_request off;
allow 127.0.0.0/8;
deny all;
}
2018-04-21 08:10:20 +02:00
location /rules.json {
auth_request off;
allow 127.0.0.0/8;
deny all;
}
# Handle test CGI
location ~ \.pl$ {
include /etc/nginx/fastcgi_params;
2016-02-16 17:00:45 +01:00
fastcgi_pass unix:__pwd__/e2e-tests/conf/llng-fastcgi.sock;
2016-02-18 13:23:53 +01:00
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;
}
2016-02-18 13:23:53 +01:00
location = /status {
include /etc/nginx/fastcgi_params;
2016-02-16 17:00:45 +01:00
fastcgi_pass unix:__pwd__/e2e-tests/conf/llng-fastcgi.sock;
2016-02-18 13:23:53 +01:00
fastcgi_param LLTYPE status;
}
}