From fbb905a5c2fa4dd4435ef2140481bfa08ccba301 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Sat, 11 Jun 2016 09:27:00 +0200 Subject: [PATCH] Move Nginx reverse proxy sample from INSTALL to separate file --- INSTALL.txt | 12 ----------- mods/sample-nginx-reverse-proxy.config | 30 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 mods/sample-nginx-reverse-proxy.config diff --git a/INSTALL.txt b/INSTALL.txt index 71671af3f1..08bd41c8d3 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -154,18 +154,6 @@ Friendica also supports a number on non-standard headers in common use. X-Forwarded-Ssl: on It is however preferable to use the standard approach if configuring a new server. -In Nginx, this can be done as follows (assuming Friendica runs on port 8080). - - location / { - if ( $scheme != https ) { # Force Redirect to HTTPS - return 302 https://$host$uri; - } - proxy_pass http://localhost:8080; - proxy_redirect off; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Forwarded "for=$proxy_add_x_forwarded_for; proto=$scheme"; - } ##################################################################### diff --git a/mods/sample-nginx-reverse-proxy.config b/mods/sample-nginx-reverse-proxy.config new file mode 100644 index 0000000000..fbbbc48802 --- /dev/null +++ b/mods/sample-nginx-reverse-proxy.config @@ -0,0 +1,30 @@ +# +# Example of NGINX as reverse-proxy terminating an HTTPS connection. +# +# This is not a complete NGINX config. +# +# Please refer to NGINX docs +# + +... + +server { + + ... + + # assuming Friendica runs on port 8080 + location / { + if ( $scheme != https ) { + # Force Redirect to HTTPS + return 302 https://$host$uri; + } + proxy_pass http://localhost:8080; + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Forwarded "for=$proxy_add_x_forwarded_for; proto=$scheme"; + } + + ... + +} -- 2.39.5