lemonldap-ng/_example/etc/portal-apache2.conf

115 lines
3.7 KiB
Plaintext
Raw Normal View History

#====================================================================
# Apache configuration for LemonLDAP::NG Portal
#====================================================================
# Uncomment this if no previous NameVirtualHost declaration
#NameVirtualHost __VHOSTLISTEN__
# To insert LLNG user id in Apache logs, declare this format and use it in
# CustomLog directive
2019-08-20 23:43:04 +02:00
#LogFormat "%v:%p %h %l %{Lm-Remote-User}o %t \"%r\" %>s %O %{Lm-Remote-Custom}o" llng
# Portal Virtual Host (auth.__DNSDOMAIN__)
<VirtualHost __VHOSTLISTEN__>
ServerName auth.__DNSDOMAIN__
# See above to set LLNG user id in Apache logs
#CustomLog __APACHELOGDIR__/portal.log llng
2017-01-03 18:23:38 +01:00
# DocumentRoot (FCGI scripts)
2017-02-28 21:40:29 +01:00
DocumentRoot __PORTALSITEDIR__
<Directory __PORTALSITEDIR__>
2014-03-05 13:21:41 +01:00
Order allow,deny
Allow from all
Options +ExecCGI +FollowSymLinks
</Directory>
2017-01-03 18:23:38 +01:00
RewriteEngine On
2017-01-04 23:19:17 +01:00
# For performances, you can put static html files: simply put the HTML
# result (example: /oauth2/checksession.html) as static file. Then
# uncomment the following line.
2019-09-25 22:46:59 +02:00
# RewriteCond "%{REQUEST_URI}" "!\.html(?:/.*)?$"
2019-09-25 19:43:46 +02:00
RewriteCond "%{REQUEST_URI}" "!^/(?:(?:static|javascript|favicon).*|.*\.fcgi(?:/.*)?)$"
2017-01-03 18:23:38 +01:00
RewriteRule "^/(.+)$" "/index.fcgi/$1" [PT]
# Uncomment this to mitigate memory leaks when using Perl 5.16
# FcgidMaxRequestsPerProcess 500
2017-01-21 14:22:52 +01:00
# Note that Content-Security-Policy header is generated by portal itself
2017-01-03 18:23:38 +01:00
<Files *.fcgi>
2016-04-01 12:46:12 +02:00
SetHandler fcgid-script
# Authorization header needs to be passed when using Kerberos or OIDC
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
Options +ExecCGI
header unset Lm-Remote-User
2016-04-01 12:46:12 +02:00
</Files>
2018-06-12 21:00:10 +02:00
# Uncomment this if status is enabled
#FcgidInitialEnv LLNGSTATUSHOST 127.0.0.1:64321
2017-01-03 18:23:38 +01:00
# Static files
Alias /static/ __PORTALSTATICDIR__
2017-01-03 18:23:38 +01:00
<Directory __PORTALSTATICDIR__>
Order allow,deny
Allow from all
Options +FollowSymLinks
</Directory>
<Location /static/>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
</IfModule>
</Location>
<IfModule mod_dir.c>
2017-01-03 18:23:38 +01:00
DirectoryIndex index.fcgi index.html
</IfModule>
# REST/SOAP functions for sessions management (disabled by default)
2017-01-03 18:23:38 +01:00
<Location /index.fcgi/adminSessions>
2014-03-05 13:21:41 +01:00
Order deny,allow
Deny from all
</Location>
# REST/SOAP functions for proxy auth and password reset (disabled by default)
<Location /index.fcgi/proxy>
Order deny,allow
Deny from all
</Location>
# REST/SOAP functions for sessions access (disabled by default)
2017-01-03 18:23:38 +01:00
<Location /index.fcgi/sessions>
2014-03-05 13:21:41 +01:00
Order deny,allow
Deny from all
</Location>
# REST/SOAP functions for configuration access (disabled by default)
2017-01-03 18:23:38 +01:00
<Location /index.fcgi/config>
2014-03-05 13:21:41 +01:00
Order deny,allow
Deny from all
</Location>
# REST/SOAP functions for notification insertion (disabled by default)
2017-01-03 18:23:38 +01:00
<Location /index.fcgi/notification>
2014-03-05 13:21:41 +01:00
Order deny,allow
Deny from all
</Location>
2019-09-09 21:37:17 +02:00
# Enable compression
2010-11-06 11:28:33 +01:00
<Location />
<IfModule mod_deflate.c>
2014-03-05 13:21:41 +01:00
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
2010-11-06 11:28:33 +01:00
</IfModule>
<IfModule mod_headers.c>
2014-03-05 13:21:41 +01:00
Header append Vary User-Agent env=!dont-vary
2010-11-06 11:28:33 +01:00
</IfModule>
</Location>
</VirtualHost>