aboutsummaryrefslogtreecommitdiff
path: root/nginx-ssl.sample.conf
blob: 0d54fc6707c584d401f7a5dce483bb4c52aa3dcf (plain) (blame)
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
upstream backend {
	server 127.0.0.1:9999; # Change to the port you specified on strelizia
}

map $sent_http_content_type $charset {
	~^text/ utf-8;
}

server {
	listen 80;
	listen [::]:80;
	server_name strelizia.cc;
	return 301 https://$server_name$request_uri;
}

server {
	listen 443 ssl http2;
	listen [::]:443 ssl http2;

	server_name strelizia.cc;
	server_tokens off;

	ssl_certificate /path/to/your/fullchain.pem;
	ssl_certificate_key /path/to/your/privkey.pem;
	ssl_trusted_certificate /path/to/your/fullchain.pem;

	client_max_body_size 100M; # Change this to the max file size you want to allow

	charset $charset;
	charset_types *;

	# Uncomment if you are running strelizia behind CloudFlare.
	# This requires NGINX compiled from source with:
	#	--with-http_realip_module
	#include /path/to/strelizia/real-ip-from-cf;

	location / {
		add_header Access-Control-Allow-Origin *;
		root /path/to/your/uploads/folder;
		try_files $uri @proxy;
	}

	location @proxy {
		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-NginX-Proxy true;
		proxy_pass http://backend;
		proxy_redirect off;
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";
		proxy_redirect off;
		proxy_set_header X-Forwarded-Proto $scheme;
	}
}