2016-02-02 07:37:37 +01:00
|
|
|
server {
|
|
|
|
listen __port__;
|
2016-02-16 17:00:45 +01:00
|
|
|
server_name test1.example.com test2.example.com;
|
2016-02-02 07:37:37 +01:00
|
|
|
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";
|
2016-02-02 07:37:37 +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;
|
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;
|
2016-02-02 07:37:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Client requests
|
2016-02-27 07:53:33 +01:00
|
|
|
location / {
|
|
|
|
index index.pl;
|
2017-02-16 18:22:08 +01:00
|
|
|
try_files $uri $uri/ =404;
|
2016-02-02 07:37:37 +01:00
|
|
|
auth_request /lmauth;
|
|
|
|
auth_request_set $lmremote_user $upstream_http_lm_remote_user;
|
2019-08-20 23:43:04 +02:00
|
|
|
auth_request_set $lmremote_custom $upstream_http_lm_remote_custom;
|
2016-02-02 07:37:37 +01:00
|
|
|
auth_request_set $lmlocation $upstream_http_location;
|
|
|
|
error_page 401 $lmlocation;
|
2016-02-27 07:53:33 +01:00
|
|
|
include conf/nginx-lua-headers.conf;
|
|
|
|
}
|
2016-02-02 07:37:37 +01:00
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2016-02-27 07:53:33 +01:00
|
|
|
# Handle test CGI
|
|
|
|
location ~ \.pl$ {
|
2016-02-02 07:37:37 +01:00
|
|
|
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-02 07:37:37 +01:00
|
|
|
|
2016-02-18 13:23:53 +01:00
|
|
|
location = /status {
|
2016-02-02 07:37:37 +01:00
|
|
|
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;
|
2016-02-02 07:37:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|