-
-
Notifications
You must be signed in to change notification settings - Fork 189
Expand file tree
/
Copy pathhttps.conf
More file actions
57 lines (44 loc) · 1.67 KB
/
https.conf
File metadata and controls
57 lines (44 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Configure ServerAdmin and ServerName
ServerName localhost
ServerAdmin webmaster@localhost
# Enable HTTP2
Protocols h2 http/1.1
SSLProtocol -all +TLSv1.2 +TLSv1.3
# Configure main document root
DocumentRoot ${APACHE_DOCUMENT_ROOT}
# Set basic settings for document root. Configure correct directory indexes and disable directory browsing
<Directory ${APACHE_DOCUMENT_ROOT}>
AllowOverride All
Require all granted
Options -Indexes +FollowSymLinks +MultiViews
DirectoryIndex index.php index.html index.htm
</Directory>
# Redirect /index.php/... to /... to prevent SEO duplicate content
RewriteEngine On
RewriteCond %{THE_REQUEST} \s/index\.php/
RewriteRule ^/index\.php(/.+)$ $1 [R=301,L,QSA]
# Healthchecks: Set /healthcheck to be the healthcheck URL
ProxyPass "/healthcheck" "fcgi://localhost:9000"
ProxyPassReverse "/healthcheck" "fcgi://localhost:9000"
# For any files that match PHP, pass it to PHP-FPM for processing
<FilesMatch "\.php$">
# 2.4.10+ can proxy to unix socket
ProxyFCGIBackendType GENERIC
SetHandler "proxy:fcgi://localhost:9000"
</FilesMatch>
# Set the Proxy Timeout to be 30 minutes
ProxyTimeout 1800
# Set environment variable for healthcheck requests
SetEnvIf Request_URI "^${HEALTHCHECK_PATH}$" dontlog
# CustomLog directive to conditionally log requests
LogFormat "%l %u %t %v %a \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" comonvhost
CustomLog /dev/stdout comonvhost env=!dontlog
# Configure Log Settings
ErrorLog /dev/stderr
LogLevel ${LOG_OUTPUT_LEVEL}
# Disable Server Signature for increased security
ServerSignature Off
# SSL Settings
SSLEngine on
SSLCertificateFile ${SSL_CERTIFICATE_FILE}
SSLCertificateKeyFile ${SSL_PRIVATE_KEY_FILE}