]> git.mxchange.org Git - friendica.git/blob - mods/sample-nginx-reverse-proxy.config
Fixes:
[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 # Note provided by Gabe R.: if you are using nginx as proxy server for Apache2
10 # make sure your nginx config DOES NOT contain the following
11 # -----
12 # location ~ /.well-known {
13 #  allow all;
14 #  }
15 # -----
16 ...
17
18 server {
19
20         ...
21
22         # assuming Friendica runs on port 8080
23         location / {
24                 if ( $scheme != https ) {
25                         # Force Redirect to HTTPS
26                         return 302 https://$host$uri;
27                 }
28                 proxy_pass http://localhost:8080;
29                 proxy_redirect off;
30                 proxy_set_header Host $host;
31                 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
32                 proxy_set_header Forwarded "for=$proxy_add_x_forwarded_for; proto=$scheme";
33         }
34
35         ...
36
37 }