Basic settings for installing Pydio on Nginx in centos

Source: Internet
Author: User
Tags documentation hash centos

There are a lot of cloud storage services, such as Baidu Cloud, 360 cloud, and Dropbox. Although the domestic cloud provides large space storage, it is always a bit weird, currently, Baidu cloud has a speed limit in terms of downloading. You have to activate a member to download it at full speed. The hundreds of megabytes of bandwidth can only be downloaded at a speed of KB, which is very uncomfortable. Dropbox and OneDrive are both foreign cloud services and GoogleDrive. Although the space provided is relatively small, they are also good-hearted. Dropbox is the best storage service I use. However, it is necessary to use it with the SS. Although OneDrive is available in China, it is not used to it.


Some time ago, when cloud storage outside China wandered over the network, it found that there was a relatively good private storage Pydio outside China, but it only needed to own its own server or host, and there was just an empty VPS at hand, so it is used to install Pydio. The official Pydio documentation provides the Apache installation and configuration method. If there is no Nginx, install it in the default mode. Unzip the Pydio installation package to the directory and install it all the way, but there will be two problems: page refresh will be 404; Windows client connection fails; where the Windows client connection will occur: Error while trying to connect to http://xxx.xxx.xx: server not found (404), is it up and has it Pydio installed? It is determined that Nginx redirection is not properly configured and the conf configuration file of the website needs to be reset. I searched around the forum and found many people with this problem. So I turned to the official documentation again, in an official article, I found a configuration method in the Debian Nginx environment. I modified the configuration in conjunction with the lnmp configuration file and successfully completed the redirection configuration, the specific configuration file is posted below to prevent forgetting:


Server
 {
Listen 80;
Server_name cloud.defel.net;
# Enforce https
Return 301 https: // $ server_name $ request_uri;
Add_header X-Frame-Options "SAMEORIGIN ";
 }
Server
    {
Listen 443 ssl;
# Listen [:]: 80;
Server_name cloud.defel.net;
Index index.html index.htm index. php default.html default.htm default. php;
### If you changed the maximum upload size in PHP. ini, also change it below
Client_max_body_size 5120 M;
# Prevent Clickjacking
Add_header X-Frame-Options "SAMEORIGIN ";
Root/home/wwwroot/cloud.defel.net;
Ssl_certificate/etc/pki/tls/certs/export cloud.defel.net_bundle.crt;
Ssl_certificate_key/etc/pki/tls/certs/2_cloud.defel.net.key;
Add_header Strict-Transport-Security "max-age = 16070400; includeSubdomains ";
  
Include other. conf;
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 ?;
# Error_page 404/404 .html;
# Remove direct access to the following folders & files
Location ~ * ^ /(? : \. | Conf | data /(? : Files | personal | logs | plugins | tmp | cache) | plugins/editor. zoho/agent/files)
  {
Deny all;
  }
Location ~ */Data/public/. *. (ser | htaccess) $
  {
Deny all;
  }
# Stops the annoying error messages in the logs
Location ~ * ^/(Favicon. ico | robots.txt)
  {
Log_not_found off;
  }
# WebDAV Rewrites
Location/shares
  {
If (! -F $ request_filename ){
Rewrite ^/shares/dav. php last;
Break;
   }

If (! -D $ request_filename ){
Rewrite ^/shares/dav. php last;
Break;
   }
  }
# Enables PHP
Location ~ \. Php $
        {
# Comment try_files $ uri = 404; to enable pathinfo
Try_files $ uri = 404;
Fastcgi_param HTTPS on;
Set $ request_url $ request_uri;
If ($ uri ~ ^/(Index | plugins ))
   {
Set $ request_url /;
   }
Fastcgi_pass unix:/tmp/php-cgi.sock;
Fastcgi_param REQUEST_URI $ request_url;
Fastcgi_index index. php;
Include fastcgi. conf;
Include fastcgi_params;
# Include pathinfo. conf;
        }
# Enables Caching
Location ~ * \. (Jpg | jpeg | png | gif | ico | css | js) $
  {
Expires 7d;
Add_header Pragma public;
Add_header Cache-Control "public, must-revalidate, proxy-revalidate ";
  }

Access_log/home/wwwlogs/cloud.defel.net. log access;
    }

The configuration file here enables SSL encryption, which is also officially recommended. If you do not need to start it, you need to make several changes: delete the redirection part; modify the listening port 443 to 80; delete two SSL certificates. At the same time, the log feature is enabled and can be disabled. In addition, you need to modify the domain name in the configuration file for other domain names. PS: You can modify the upload size in php. ini:

Vi/etc/php. ini

Find and modify the following:

[...]
Upload_max_filesize = 1024 M
[...]
Post_max_size = 1024 M
[...]
Output_buffering = Off
[...]

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.