lemonldap-ng/_example/etc/test-nginx.conf

76 lines
2.1 KiB
Plaintext
Raw Normal View History

2016-02-02 07:23:27 +01:00
server {
listen __PORT__;
2016-02-16 17:01:32 +01:00
server_name test1.__DNSDOMAIN__ test2.__DNSDOMAIN__;
root __TESTDIR__;
2016-02-02 07:23:27 +01:00
# Internal authentication request
location = /lmauth {
internal;
include /etc/nginx/fastcgi_params;
2016-02-15 22:12:56 +01:00
fastcgi_pass unix:__FASTCGISOCKDIR__/llng-fastcgi.sock;
2016-02-02 07:23:27 +01:00
# 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
2016-02-24 20:18:44 +01:00
location ~ \.pl(?:$|/) {
2016-02-02 07:23:27 +01:00
auth_request /lmauth;
auth_request_set $lmremote_user $upstream_http_lm_remote_user;
auth_request_set $lmlocation $upstream_http_location;
error_page 401 $lmlocation;
2016-02-18 13:23:55 +01:00
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:__FASTCGISOCKDIR__/llng-fastcgi.sock;
fastcgi_param LLTYPE cgi;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_split_path_info ^(.*\.pl)(/.+)$;
2016-02-16 17:01:32 +01:00
# Set REMOTE_USER (for FastCGI apps only)
2016-02-18 13:23:55 +01:00
fastcgi_param REMOTE_USER $lmremote_user;
2016-02-16 17:01:32 +01:00
##################################
# PASSING HEADERS TO APPLICATION #
##################################
2016-02-02 07:23:27 +01:00
# IF LUA IS SUPPORTED
2016-02-24 07:54:18 +01:00
#include __CONFDIR__/nginx-lua-headers.conf;
2016-02-02 07:23:27 +01:00
# ELSE
# Set manually your headers
#auth_request_set $authuser $upstream_http_auth_user;
#proxy_set_header Auth-User $authuser;
2016-02-02 07:23:27 +01:00
# OR
#fastcgi_param HTTP_AUTH_USER $authuser;
2016-02-02 07:23:27 +01:00
2016-02-25 10:09:07 +01:00
# Then (if LUA not supported), change cookie header to hide LLNG cookie
#auth_request_set $lmcookie $upstream_http_cookie;
#proxy_set_header Cookie: $lmcookie;
# OR
#fastcgi_param HTTP_COOKIE $lmcookie;
# Uncomment this if you use https only
#add_header Strict-Transport-Security "15768000";
2016-02-02 07:23:27 +01:00
}
2016-02-24 20:18:44 +01:00
index index.pl;
2016-02-18 13:23:55 +01:00
location / {
try_files $uri $uri/ =404;
}
2016-02-02 07:23:27 +01:00
2016-02-18 13:23:55 +01:00
#location = /status {
# allow 127.0.0.1;
# deny all;
# include /etc/nginx/fastcgi_params;
2016-02-15 19:15:43 +01:00
# fastcgi_pass unix:__FASTCGISOCKDIR__/llng-fastcgi.sock;
# fastcgi_param LLTYPE status;
#}
2016-02-02 07:23:27 +01:00
}