]> git.mxchange.org Git - friendica.git/blob - mods/sample-nginx-reverse-proxy.config
Merge pull request #3472 from rabuzarus/feature/frio/fixedaside2
[friendica.git] / mods / sample-nginx-reverse-proxy.config
1 #
2 # Example of NGINX as reverse-proxy terminating an HTTPS connection.
3 #
4 # This is not a complete NGINX config.
5 #
6 # Please refer to NGINX docs
7 #
8
9 ...
10
11 server {
12
13         ...
14
15         # assuming Friendica runs on port 8080
16         location / {
17                 if ( $scheme != https ) {
18                         # Force Redirect to HTTPS
19                         return 302 https://$host$uri;
20                 }
21                 proxy_pass http://localhost:8080;
22                 proxy_redirect off;
23                 proxy_set_header Host $host;
24                 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
25                 proxy_set_header Forwarded "for=$proxy_add_x_forwarded_for; proto=$scheme";
26         }
27
28         ...
29
30 }