1
0
Fork 0

Merge pull request #2588 from fabrixxm/nginx-sample-docs

Move Nginx reverse proxy sample from INSTALL to separate file
This commit is contained in:
Michael Vogel 2016-06-11 10:27:53 +02:00 committed by GitHub
commit 212fc203d9
2 changed files with 30 additions and 12 deletions

View file

@ -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";
}
#####################################################################

View file

@ -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";
}
...
}