blob: 8333a193b25f8e09d46c1f6917c3d3e1b1b4beac (
plain)
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
|
## http server redirecting to https
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri;
}
## sample http server, if no https is being used, if you use this comment the https server section
#server {
# listen 80;
# server_name example.com;
# root /usr/share/webapps/filebin;
# index index.php index.html index.htm;
# location / {
# # First attempt to serve request as file, then
# # as directory, then fall back to displaying a 404.
# try_files $uri $uri/ /index.php /index.html;
# }
# location ~ ^(.+\.php)(.*)$ {
# try_files $fastcgi_script_name =404;
# fastcgi_split_path_info ^(.+\.php)(.*)$;
# fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_param PATH_INFO $fastcgi_path_info;
# include /etc/nginx/fastcgi_params;
# }
#}
## Config for server secured with https
server {
listen 443;
root /usr/share/webapps/filebin;
index index.php index.html index.htm;
server_name example.com;
ssl on;
ssl_certificate certificate.crt;
ssl_certificate_key private-key.key;
ssl_session_timeout 5m;
ssl_ciphers 'AES128+EECDH:AES128+EDH';
ssl_prefer_server_ciphers on;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php /index.html;
}
location ~ ^(.+\.php)(.*)$ {
try_files $fastcgi_script_name =404;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include /etc/nginx/fastcgi_params;
}
}
|