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

66 lines
1.8 KiB
Plaintext
Raw Normal View History

server {
listen __PORT__;
listen [::]:__PORT__;
server_name manager.__DNSDOMAIN__;
2017-02-28 21:40:29 +01:00
root __MANAGERSITEDIR__;
2018-05-22 15:06:45 +02:00
# Use "lm_app" format to get username in nginx.log (see nginx-lmlog.conf)
2019-08-06 14:32:37 +02:00
#access_log /var/log/nginx/manager.log lm_app;
# Uncomment this if you are running behind a reverse proxy and want
# LemonLDAP::NG to see the real IP address of the end user
# Adjust the settings to match the IP address of your reverse proxy
# and the header containing the original IP address
# As an alternative, you can use the PROXY protocol
#
#set_real_ip_from 127.0.0.1;
#real_ip_header X-Forwarded-For;
2018-06-07 18:58:55 +02:00
if ($uri !~ ^/(.*\.psgi|static|doc|lib|javascript|favicon)) {
rewrite ^/(.*)$ /manager.psgi/$1 break;
}
2018-03-27 21:50:22 +02:00
location ~ ^(?<sc>/.*\.psgi)(?:$|/) {
2018-03-22 21:52:00 +01:00
# FastCGI configuration
include /etc/nginx/fastcgi_params;
2016-02-15 22:12:56 +01:00
fastcgi_pass unix:__FASTCGISOCKDIR__/llng-fastcgi.sock;
fastcgi_param LLTYPE psgi;
2017-01-18 20:47:29 +01:00
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
2017-01-18 18:55:04 +01:00
fastcgi_split_path_info ^(.*\.psgi)(/.*)$;
2017-01-09 22:54:06 +01:00
fastcgi_param PATH_INFO $fastcgi_path_info;
2018-03-22 21:52:00 +01:00
2022-10-23 21:15:24 +02:00
# Or with uWSGI
2018-03-22 21:52:00 +01:00
#include /etc/nginx/uwsgi_params;
#uwsgi_pass 127.0.0.1:5000;
#uwsgi_param LLTYPE psgi;
2018-03-27 21:50:22 +02:00
#uwsgi_param SCRIPT_FILENAME $document_root$sc;
#uwsgi_param SCRIPT_NAME $sc;
}
location / {
2016-02-18 13:23:55 +01:00
index manager.psgi;
try_files $uri $uri/ =404;
allow 127.0.0.0/8;
allow ::1/128;
deny all;
}
2016-02-16 12:19:32 +01:00
2016-02-21 09:29:19 +01:00
location /doc/ {
alias __DEFDOCDIR__;
index index.html start.html;
2016-02-21 09:29:19 +01:00
}
location /lib/ {
2017-01-18 22:13:08 +01:00
alias __DEFDOCDIR__pages/documentation/current/lib/;
2016-02-21 09:29:19 +01:00
}
2017-01-18 22:13:08 +01:00
location /static/ {
alias __MANAGERSTATICDIR__;
}
# DEBIAN
# If install was made with USEDEBIANLIBS (official releases), uncomment this
#location /javascript/ {
# alias /usr/share/javascript/;
#}
}