File: nginx.conf.nohttps.example

package info (click to toggle)
diaspora-installer 0.7.6.1+debian1
  • links: PTS, VCS
  • area: contrib
  • in suites: bullseye, buster, sid
  • size: 456 kB
  • sloc: sh: 895; makefile: 8
file content (69 lines) | stat: -rw-r--r-- 2,019 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
upstream domain11 {
        server unix:/usr/share/diaspora/tmp/diaspora.sock;
}

server {
            listen   80;
            server_name SERVERNAME_FIXME www.SERVERNAME_FIXME;

            proxy_set_header   X-Real-IP  $remote_addr;
            proxy_set_header   X-FORWARDED-PROTO http;

            access_log /var/log/diaspora/access.log;
            error_log /var/log/diaspora/error.log;

            root   DIASPORA_ROOT_FIXME/public/;
            index  index2.html;

            if ($http_user_agent ~* Googlebot) {
                return 403;
            }

	    location /uploads/images {
	      expires 1d;
	      add_header Cache-Control public;
	    }

            location /assets {
              expires 1d;
              add_header Cache-Control public;
            }

            location / {
                          proxy_set_header X-Real-IP $remote_addr;
                          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                          proxy_set_header Host $http_host;
                          proxy_set_header X-Forwarded-Proto http;
                          proxy_redirect off;

                          client_max_body_size 4M;
                          client_body_buffer_size 128K;

                          if (-f $request_filename/index.html) {
                                           rewrite (.*) $1/index.html break;
                          }

                          if (-f $request_filename.html) {
                                           rewrite (.*) $1.html break;
                          }

                          if (!-f $request_filename) {
                                           proxy_pass http://domain11;

                                           break;
                          }
            }

	if ($http_user_agent ~ "Python-urllib" ) {
		return 403;
	}

	if ($http_user_agent ~ "libwww-perl" ) {
		return 403;
	}

	error_page 500 502 503 504  /50x.html;
	location = /50x.html {
		root  DIASPORA_ROOT_FIXME;
	}
}