This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
forked from theGeoffrey/pydio-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpydio-nginx.conf
100 lines (80 loc) · 3.52 KB
/
pydio-nginx.conf
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
server {
listen 443 ssl;
root /var/www/pydio-core;
index index.php;
# Set the maximum body size of a request.
# Note: If you changed the maximum upload size in /etc/php5/fpm/php.ini, also change it below.
client_max_body_size 64M;
# Prevent Clickjacking
add_header X-Frame-Options "SAMEORIGIN";
# SSL Settings
# See: https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
# Verify your installation at: https://www.ssllabs.com/ssltest/
ssl on;
ssl_certificate /pydio-config/pydio.crt;
ssl_certificate_key /pydio-config/pydio.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_session_cache shared:SSL:10m;
add_header Strict-Transport-Security "max-age=16070400; includeSubdomains";
#---------------------------------------
keepalive_requests 10;
keepalive_timeout 60 60;
access_log /var/log/nginx/pydio_access.log;
error_log /var/log/nginx/pydio_error.log;
client_body_buffer_size 128k;
rewrite ^/dashboard|^/settings|^/welcome|^/ws- /index.php last;
if ( !-e $request_filename ) {
# WebDAV Rewrites
rewrite ^/shares /dav.php last;
# Sync client
rewrite ^/api /rest.php last;
# External users
rewrite ^/user ./index.php?get_action=user_access_point last;
# Public shares
rewrite ^/data/public/([a-zA-Z0-9_-]+)\.php$ /data/public/share.php?hash=$1?;
}
rewrite ^/data/public/([a-zA-Z0-9_-]+)--([a-z]+)$ /data/public/share.php?hash=$1&lang=$2?;
rewrite ^/data/public/([a-zA-Z0-9_-]+)$ /data/public/share.php?hash=$1?;
# Only allow these request methods and do not accept DELETE, SEARCH and other methods
if ( $request_method !~ ^(GET|HEAD|POST|PROPFIND|OPTIONS)$ ) {
return 444;
}
location ~* ^/(?:\.|conf|data/(?:files|personal|logs|plugins|tmp|cache)|plugins/editor.zoho/agent/files) {
deny all;
}
# Enables PHP
location ~ \.php$ {
# for ^/(index|plugins) request_uri should be changed
set $request_url $request_uri;
if ( $uri ~ ^/(index|plugins) ) {
set $request_url /;
}
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_url;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
# Enables Caching
location ~* \.(ico|css|js)$ {
expires 7d;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
}