Pydio conf file for nginx

Suggestions for features and software you would like to see in DietPi, goes here.
Post Reply
studioai

Pydio conf file for nginx

Post by studioai »

Hi Fourdee! Thanks for this awesome project!

I wrote a nginx conf file for pydio!

pydio works fine with it in /etc/nignx/sites-dietpi, even webdav and file share link redirection are OK!

So, Please. Apply this file to next dietpi release.

Then, I'll be happy for my little contribution to this wonderful project.

Code: Select all

    
        rewrite ^/pydio/dashboard|^/pydio/settings|^/pydio/welcome|^/ws- /pydio/index.php last;
        
	if ( !-e $request_filename ) {
		# WebDAV Rewrites
		rewrite ^/pydio/shares /pydio/dav.php last;
		# Sync client
		rewrite ^/pydio/api /pydio/rest.php last;
		# External users 
		rewrite ^/pydio/user /pydio/index.php?get_action=user_access_point last;
		# Public shares
		rewrite ^/pydio/data/public/([a-zA-Z0-9_-]+)\.php$ /pydio/data/public/share.php?hash=$1?;
	}
	rewrite ^/pydio/data/public/([a-zA-Z0-9_-]+)--([a-z]+)$ /pydio/data/public/share.php?hash=$1&lang=$2?;
	rewrite ^/pydio/data/public/([a-zA-Z0-9_-]+)$ /pydio/data/public/share.php?hash=$1?;

	# Prevent Clickjacking
	add_header X-Frame-Options "SAMEORIGIN";

	# 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 ~* ^/pydio/(?:\.|conf|data/(?:files|personal|logs|plugins|tmp|cache)|plugins/editor.zoho/agent/files) {
		deny all;
	}

   # Enables Caching
	location ~* \.(ico|css|js)$ {
		expires 7d;
		add_header Pragma public;
		add_header Cache-Control "public, must-revalidate, proxy-revalidate";
	}

P.S: I modified dietpi-cloudshell script, http://dietpi.com/phpbb/viewtopic.php?f=11&t=310 I want you to see the script I wrote and consider apply it as new feature in next build.
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: Pydio conf file for nginx

Post by k-plan »

Hi studioai,

great work and good suggestion.
Will be nice, to put it on github, if it is no problem for you. => https://github.com/Fourdee/DietPi/issues
Only to prevent it will disappear. Thanks.

cu
k-plan
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: Pydio conf file for nginx

Post by k-plan »

Hi studioai,

many thanks for creating a github ticket: https://github.com/Fourdee/DietPi/issues/297
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
Post Reply