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

95 lines
3.0 KiB
Plaintext
Raw Normal View History

#====================================================================
# Apache configuration for LemonLDAP::NG Portal
#====================================================================
# Uncomment this if no previous NameVirtualHost declaration
#NameVirtualHost __VHOSTLISTEN__
# Portal Virtual Host (auth.__DNSDOMAIN__)
<VirtualHost __VHOSTLISTEN__>
ServerName auth.__DNSDOMAIN__
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.
# RewriteCond "%{REQUEST_FILENAME}" "!\.html$"
2017-01-03 18:23:38 +01:00
RewriteCond "%{REQUEST_FILENAME}" "!^/(?:(?:static|javascript|favicon).*|.*\.fcgi)$"
RewriteRule "^/(.+)$" "/index.fcgi/$1" [PT]
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
2017-04-11 14:57:52 +02:00
CGIPassAuth on
2016-04-01 12:46:12 +02:00
Options +ExecCGI
</Files>
2017-01-03 18:23:38 +01:00
# Static files
Alias /static/ __PORTALSTATICDIR__/
<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>
# 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>
# 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>
# 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>
# 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>
2017-01-03 18:23:38 +01:00
# Enabe 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>
# Uncomment this if site if you use SSL only
#Header set Strict-Transport-Security 15768000
</VirtualHost>