Recommended pleroma nginx config

This commit is contained in:
Bob Mottram 2018-01-25 14:57:14 +00:00
parent a89024596c
commit 76d24b01cd
1 changed files with 25 additions and 1 deletions

View File

@ -875,6 +875,9 @@ function install_pleroma {
if [[ $ONION_ONLY == "no" ]]; then
function_check nginx_http_redirect
nginx_http_redirect $PLEROMA_DOMAIN_NAME "index index.html"
echo '' >> $pleroma_nginx_site
echo 'proxy_cache_path /tmp/pleroma-media-cache levels=1:2 keys_zone=pleroma_media_cache:10m max_size=100m inactive=80m use_temp_path=off;' >> $pleroma_nginx_site
echo '' >> $pleroma_nginx_site
echo 'server {' >> $pleroma_nginx_site
echo ' listen 443 ssl;' >> $pleroma_nginx_site
echo ' listen [::]:443 ssl;' >> $pleroma_nginx_site
@ -902,12 +905,23 @@ function install_pleroma {
echo ' location / {' >> $pleroma_nginx_site
function_check nginx_limits
nginx_limits $PLEROMA_DOMAIN_NAME '15m'
echo ' proxy_http_version 1.1;' >> $pleroma_nginx_site
echo ' proxy_set_header Upgrade $http_upgrade;' >> $pleroma_nginx_site
echo ' proxy_set_header Connection "upgrade";' >> $pleroma_nginx_site
echo " proxy_pass http://localhost:$PLEROMA_PORT;" >> $pleroma_nginx_site
echo ' }' >> $pleroma_nginx_site
echo '' >> $pleroma_nginx_site
echo ' location /proxy {' >> $pleroma_nginx_site
nginx_limits $PLEROMA_DOMAIN_NAME '15m'
echo ' proxy_cache pleroma_media_cache;' >> $pleroma_nginx_site
echo ' proxy_cache_lock on;' >> $pleroma_nginx_site
echo " proxy_pass http://localhost:$PLEROMA_PORT;" >> $pleroma_nginx_site
echo ' }' >> $pleroma_nginx_site
echo ' # include snippets/well-known.conf;' >> $pleroma_nginx_site
echo '}' >> $pleroma_nginx_site
else
echo -n '' > $pleroma_nginx_site
echo 'proxy_cache_path /tmp/pleroma-media-cache levels=1:2 keys_zone=pleroma_media_cache:10m max_size=100m inactive=80m use_temp_path=off;' >> $pleroma_nginx_site
echo '' >> $pleroma_nginx_site
fi
echo 'server {' >> $pleroma_nginx_site
echo " listen 127.0.0.1:$PLEROMA_ONION_PORT default_server;" >> $pleroma_nginx_site
@ -929,6 +943,16 @@ function install_pleroma {
echo ' location / {' >> $pleroma_nginx_site
function_check nginx_limits
nginx_limits $PLEROMA_DOMAIN_NAME '15m'
echo ' proxy_http_version 1.1;' >> $pleroma_nginx_site
echo ' proxy_set_header Upgrade $http_upgrade;' >> $pleroma_nginx_site
echo ' proxy_set_header Connection "upgrade";' >> $pleroma_nginx_site
echo " proxy_pass http://localhost:$PLEROMA_PORT;" >> $pleroma_nginx_site
echo ' }' >> $pleroma_nginx_site
echo '' >> $pleroma_nginx_site
echo ' location /proxy {' >> $pleroma_nginx_site
nginx_limits $PLEROMA_DOMAIN_NAME '15m'
echo ' proxy_cache pleroma_media_cache;' >> $pleroma_nginx_site
echo ' proxy_cache_lock on;' >> $pleroma_nginx_site
echo " proxy_pass http://localhost:$PLEROMA_PORT;" >> $pleroma_nginx_site
echo ' }' >> $pleroma_nginx_site
echo ' # include snippets/well-known.conf;' >> $pleroma_nginx_site