forked from elm/package.elm-lang.org
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnginx.conf
44 lines (38 loc) · 1.13 KB
/
nginx.conf
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
map $request_uri $desired_scheme {
default "https";
~elm-package-version=0.1[6-8] "http";
}
server {
if ($scheme != $desired_scheme) { return 301 $desired_scheme://$host$request_uri; }
listen 80;
server_name package.elm-lang.org;
location / {
proxy_pass http://localhost:8000;
}
}
server {
listen 443 ssl;
server_name package.elm-lang.org;
location / {
proxy_pass http://localhost:8019;
}
location /packages/ {
root /home/prod/websites/package;
try_files $uri @fallback;
}
location /assets/ {
root /home/prod/websites/package;
try_files $uri @fallback;
}
location /artifacts/ {
root /home/prod/websites/package;
try_files $uri @fallback;
}
location @fallback {
proxy_pass http://localhost:8019;
}
ssl_certificate /etc/letsencrypt/live/package.elm-lang.org/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/package.elm-lang.org/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}