-
Notifications
You must be signed in to change notification settings - Fork 305
Expand file tree
/
Copy pathapache-le-ssl.conf
More file actions
55 lines (44 loc) · 2.06 KB
/
Copy pathapache-le-ssl.conf
File metadata and controls
55 lines (44 loc) · 2.06 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
# Overleaf let's encrypt reverse proxy configuration file for apache2 webserver
<VirtualHost *:443>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName overleaf.example.com
ServerAdmin sysadmin@example.com
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error-overleaf.log
CustomLog ${APACHE_LOG_DIR}/access-overleaf.log combined
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:8080/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*) http://127.0.0.1:8080/$1 [P,L]
<IfModule mod_proxy.c>
ProxyRequests Off
ProxyPassReverse / http://127.0.0.1:8080/
</IfModule>
<IfModule mod_ssl.c>
SSLCertificateFile /etc/letsencrypt/live/overleaf.example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/overleaf.example.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</IfModule>
# To avoid SSL stripping https://en.wikipedia.org/wiki/SSL_stripping#SSL_stripping
Header always set Strict-Transport-Security "max-age=31536000; includeSubdomains;"
#ServerTokens Prod
LimitRequestBody 52428800
<Location />
ProxyAddHeaders On
RequestHeader set X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-For "%{REMOTE_ADDR}s"
RequestHeader set Host "%{HTTP_HOST}e"
</Location>
</VirtualHost>