X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=installation%2Fpleroma.nginx;h=b8abdce22a825f07de5d291a1fd51687f444a21b;hb=d81a4e92809d6dc7d3d3fb4ce85e5f94c1e23f0a;hp=61e40c508239f984bf0dca460e1064c4d2734b39;hpb=210755ac46d7f1b909b74c75e9c7cce4dd9df7ba;p=akkoma diff --git a/installation/pleroma.nginx b/installation/pleroma.nginx index 61e40c508..b8abdce22 100644 --- a/installation/pleroma.nginx +++ b/installation/pleroma.nginx @@ -4,7 +4,7 @@ # 1. Install your TLS certificate, possibly using Let's Encrypt. # 2. Replace 'example.tld' with your instance's domain wherever it appears. # 3. Copy this file to /etc/nginx/sites-available/ and then add a symlink to it -# in /etc/nginx/sites-enabled/ and restart nginx. +# in /etc/nginx/sites-enabled/ and run 'nginx -s reload' or restart nginx. proxy_cache_path /tmp/pleroma-media-cache levels=1:2 keys_zone=pleroma_media_cache:10m max_size=10g inactive=720m use_temp_path=off; @@ -13,6 +13,15 @@ server { listen 80; server_name example.tld; return 301 https://$server_name$request_uri; + + # Uncomment this if you need to use the 'webroot' method with certbot. Make sure + # that you also create the .well-known/acme-challenge directory structure in pleroma/priv/static and + # that is is accessible by the webserver. You may need to load this file with the ssl + # server block commented out, run certbot to get the certificate, and then uncomment it. + # + # location ~ /\.well-known/acme-challenge { + # root /pleroma/priv/static/; + # } } server { @@ -45,11 +54,22 @@ server { add_header 'Access-Control-Allow-Origin' '*' always; add_header 'Access-Control-Allow-Methods' 'POST, GET, OPTIONS' always; add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always; + add_header 'Access-Control-Expose-Headers' 'Link, X-RateLimit-Reset, X-RateLimit-Limit, X-RateLimit-Remaining, X-Request-Id' always; if ($request_method = OPTIONS) { return 204; } # stop removing lines here. + add_header X-XSS-Protection "1; mode=block"; + add_header X-Permitted-Cross-Domain-Policies none; + add_header X-Frame-Options DENY; + add_header X-Content-Type-Options nosniff; + add_header Referrer-Policy same-origin; + add_header X-Download-Options noopen; + + # Uncomment this only after you get HTTPS working. + # add_header Strict-Transport-Security "max-age=31536000; includeSubDomains"; + proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";