actor: use LFU cache to break cycles
[relay.git/.git] / installation / relay.nginx
1 # Example nginx config for ActivityRelay
2
3 # how to use this config.
4 # 1. Create web roots if needed.
5 # 2. change paths and everywhere it says <yourdomain>.
6 # 3. get a SSL cert, this config can be used for letsencrypt's webroot mode 
7 # 4. reload nginx
8
9 server {
10   listen 80;
11   listen [::]:80;
12   server_name relay.<yourdomain>;
13   root /srv/www/relay.<yourdomain>/htdocs;
14   # don't redirect for letsencrypt.
15   location /.well-known/acme-challenge/ {
16   }
17   location / {
18     return 301 https://relay.<yourdomain>$request_uri;
19   }
20 }
21
22 # if you don't have a ssl cert yet, comment out the next block and use certbot to fetch one.
23 server {
24   listen 443 ssl;
25   server_name relay.<yourdomain>;
26   root /srv/www/relay.<yourdomain>/htdocs;
27
28   # logging, mostly for debug purposes. Disable if you wish.
29   access_log /srv/www/relay.<yourdomain>/logs/access.log;
30   error_log /srv/www/relay.<yourdomain>/logs/error.log;
31   
32   ssl_protocols TLSv1.2;
33   ssl_ciphers EECDH+AESGCM:EECDH+AES;
34   ssl_ecdh_curve secp384r1;
35   ssl_prefer_server_ciphers on;
36   ssl_session_cache shared:SSL:10m;
37   
38   # ssl certs. 
39   ssl_certificate     /usr/local/etc/letsencrypt/live/relay.<yourdomain>/fullchain.pem;
40   ssl_certificate_key /usr/local/etc/letsencrypt/live/relay.<yourdomain>/privkey.pem;
41
42   keepalive_timeout    70;
43   sendfile             on;
44   client_max_body_size 0;
45   gzip off;
46
47   server_name relay.<yourdomain>;
48
49   # sts, change if you care.
50   # add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";
51   
52   # uncomment this to use a static page in your webroot for your root page.
53   #location = / {
54   #  index index.html;
55   #}
56
57   location / {
58     try_files $uri @proxy;
59   }
60
61   location @proxy {
62     proxy_set_header Host $host;
63     proxy_set_header X-Real-IP $remote_addr;
64     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
65     proxy_set_header X-Forwarded-Proto https;
66     proxy_pass_header Server;
67     # change as needed.
68     proxy_pass http://127.0.0.1:8080;
69     proxy_buffering off;
70     proxy_redirect off;
71     proxy_http_version 1.1;
72   }
73 }
74