Add documentation to nginx handler
The test-nginx.conf file describes how to create a vhost using nginx handler. But there is no documentation about how to create a virtual host which will only proxy pass request to a backend server.
it would be nice to have a proxy_pass_nginx example.conf in documentation (as well as an Apache proxy pass example by the way)
A possible example file:
rvprx file common to all virtual host:
location = /lmauth {
internal;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/llng-fastcgi-server/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 / {
try_files $uri @proxy;
auth_request /lmauth;
auth_request_set $lmremote_user $upstream_http_lm_remote_user;
auth_request_set $lmlocation $upstream_http_location;
error_page 401 $lmlocation;
##################################
# PASSING HEADERS TO APPLICATION #
##################################
include /etc/lemonldap-ng/nginx-lua-headers.conf;
# Uncomment this if you use https only
add_header Strict-Transport-Security "15768000";
}
{code}
And for each specific file:
{code:nginx}
server {
listen 80;
server_name example.fr;
include /etc/nginx/rvprx;
location @proxy {
proxy_pass http://backend.fr;
proxy_redirect http://backend.fr http://example.fr;
#proxy_cookie_domain backend.fr example.fr;
}
}
Of course this only apply to Nginx using LUA to forge headers but I think this kind of documentation could be of great help