Discussion:
[sabredav] SabreDav and Nginx configuration
WG
2016-12-22 23:59:48 UTC
Permalink
Hi there!

Thanks for all the work, I used sabredav multiple times on apache servers
and it always worked great. Now I trying to set it up with ubuntu and
nginx, but with no luck. I'm having a hard time routing the request to
my-domain.com/calendarserver.php/

Without the trailing slash I get an error:

<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:sabredav-version>3.1.3</s:sabredav-version>
<s:exception>Sabre\DAV\Exception\NotFound</s:exception>
<s:message>File not found: calendarserver.php in 'root'</s:message>
</d:error>


But with the trailing slash I get an Access Denied error, because my .php/
is not a supported extension. Do I need to add this extension in my php
config? Here is the error:

[error] 18564#18564: *290 FastCGI sent in stderr: "Access to the script
'/home/my-domain.com/public/calendarserver.php/' has been denied (see
security.limit_extensions)" while reading response header from upstream,
client: xx.xx.xx.xx, server: my-domain.com, request: "GET
/calendarserver.php/ HTTP/1.1", upstream:
"fastcgi://unix:/var/run/php/php7.1-fpm.sock:", host: "my-domain.com"

A lot of people should have installed sabredav with nginx, right? I must be
doing something completly wrong. Here is my location rule:

location ^~ /calendarserver.php/ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
include fastcgi_params;
}

The reason I specifically match this, is that all other php requests are
handled by a framework. But all other location rules are commented out for
testing. So there is no other routing. I would even move the whole
framework, which serves an api, to another subdomain, but I would still
need to configure nginx...

Any ideas? Thanks!!
--
You received this message because you are subscribed to the Google Groups "SabreDAV Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sabredav-discuss+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sabredav-discuss/d2816fdf-0448-4ec0-bc99-70b72432e31e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Evert Pot
2016-12-28 00:34:49 UTC
Permalink
Hi WG,
Post by WG
Hi there!
Thanks for all the work, I used sabredav multiple times on apache servers
and it always worked great. Now I trying to set it up with ubuntu and
nginx, but with no luck. I'm having a hard time routing the request to
my-domain.com/calendarserver.php/
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:sabredav-version>3.1.3</s:sabredav-version>
<s:exception>Sabre\DAV\Exception\NotFound</s:exception>
<s:message>File not found: calendarserver.php in 'root'</s:message>
</d:error>
But with the trailing slash I get an Access Denied error, because my .php/
is not a supported extension. Do I need to add this extension in my php
[error] 18564#18564: *290 FastCGI sent in stderr: "Access to the script
'/home/my-domain.com/public/calendarserver.php/' has been denied (see
security.limit_extensions)" while reading response header from upstream,
client: xx.xx.xx.xx, server: my-domain.com, request: "GET
"fastcgi://unix:/var/run/php/php7.1-fpm.sock:", host: "my-domain.com"
A lot of people should have installed sabredav with nginx, right? I must
location ^~ /calendarserver.php/ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
include fastcgi_params;
}
The reason I specifically match this, is that all other php requests are
handled by a framework. But all other location rules are commented out for
testing. So there is no other routing. I would even move the whole
framework, which serves an api, to another subdomain, but I would still
need to configure nginx...
Any ideas? Thanks!!
sabre/dav relies on a feature often called "PATH_INFO". The baikal
documentation has some sample nginx configuration that also applies to
sabre/dav:

http://sabre.io/baikal/install/

Using those settings should fix this problem.

Evert
--
You received this message because you are subscribed to the Google Groups "SabreDAV Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sabredav-discuss+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sabredav-discuss/26e2f9c1-e91a-44cb-acbd-c75d6d95aa40%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
WG
2016-12-28 08:36:00 UTC
Permalink
Hi Evert!

Thanks for your reply. I used the baikal config, restarted nginx and now
the calendarserver.php/ is read. However, now I get the :

File not found: calendarserver.php in 'root'


error. But the base uri should be fine. I'm running on a subdomain
(kalender.my-domain.de), but there is no subdirectory. I'm running the
server.php from the directory, which is the root in the nginx
configuration. And I can even hit the server.php and everything works fine.
I can even upload files. It's just the calendarserver.php/ that's throwing
an error.

If I try to list the plugins from the server.php there is also an error:

Requested uri (/server.php?sabreAction=plugins) is out of base uri
(server.php/)

But the base uri is defaulting to 'server.php' in my server.php. Without
the trailing slash.

Any ideas? Thank you so much for your help.
Post by Evert Pot
Hi WG,
Post by WG
Hi there!
Thanks for all the work, I used sabredav multiple times on apache servers
and it always worked great. Now I trying to set it up with ubuntu and
nginx, but with no luck. I'm having a hard time routing the request to
my-domain.com/calendarserver.php/
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:sabredav-version>3.1.3</s:sabredav-version>
<s:exception>Sabre\DAV\Exception\NotFound</s:exception>
<s:message>File not found: calendarserver.php in 'root'</s:message>
</d:error>
But with the trailing slash I get an Access Denied error, because my
.php/ is not a supported extension. Do I need to add this extension in my
[error] 18564#18564: *290 FastCGI sent in stderr: "Access to the script
'/home/my-domain.com/public/calendarserver.php/' has been denied (see
security.limit_extensions)" while reading response header from upstream,
client: xx.xx.xx.xx, server: my-domain.com, request: "GET
"fastcgi://unix:/var/run/php/php7.1-fpm.sock:", host: "my-domain.com"
A lot of people should have installed sabredav with nginx, right? I must
location ^~ /calendarserver.php/ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
include fastcgi_params;
}
The reason I specifically match this, is that all other php requests are
handled by a framework. But all other location rules are commented out for
testing. So there is no other routing. I would even move the whole
framework, which serves an api, to another subdomain, but I would still
need to configure nginx...
Any ideas? Thanks!!
sabre/dav relies on a feature often called "PATH_INFO". The baikal
documentation has some sample nginx configuration that also applies to
http://sabre.io/baikal/install/
Using those settings should fix this problem.
Evert
--
You received this message because you are subscribed to the Google Groups "SabreDAV Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sabredav-discuss+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sabredav-discuss/25d761bd-a2e0-47d6-b512-11a64fd62dc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Evert Pot
2017-01-02 18:31:31 UTC
Permalink
Post by WG
Hi Evert!
Thanks for your reply. I used the baikal config, restarted nginx and now
File not found: calendarserver.php in 'root'
error. But the base uri should be fine. I'm running on a subdomain (
kalender.my-domain.de), but there is no subdirectory. I'm running the
server.php from the directory, which is the root in the nginx
configuration. And I can even hit the server.php and everything works fine.
I can even upload files. It's just the calendarserver.php/ that's throwing
an error.
Requested uri (/server.php?sabreAction=plugins) is out of base uri
(server.php/)
But the base uri is defaulting to 'server.php' in my server.php. Without
the trailing slash.
Any ideas? Thank you so much for your help.
In this particular case it's the preceeding slash that you're missing. For
the error that you just got, the base uri should be : /server.php/

Evert
--
You received this message because you are subscribed to the Google Groups "SabreDAV Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sabredav-discuss+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sabredav-discuss/c62f3596-bd62-43dd-bf23-d31d411bd6f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
WG
2017-01-02 19:16:15 UTC
Permalink
Hi Evert!

Thank you so much for your help. Settings the baseUri to '/server.php/' in
server.php didn't help. I still got the same error. But setting the baseUri
to '/calendarserver.php/' in calendarserver.php did the job.
Post by Evert Pot
Post by WG
Hi Evert!
Thanks for your reply. I used the baikal config, restarted nginx and now
File not found: calendarserver.php in 'root'
error. But the base uri should be fine. I'm running on a subdomain (
kalender.my-domain.de), but there is no subdirectory. I'm running the
server.php from the directory, which is the root in the nginx
configuration. And I can even hit the server.php and everything works fine.
I can even upload files. It's just the calendarserver.php/ that's throwing
an error.
Requested uri (/server.php?sabreAction=plugins) is out of base uri
(server.php/)
But the base uri is defaulting to 'server.php' in my server.php. Without
the trailing slash.
Any ideas? Thank you so much for your help.
In this particular case it's the preceeding slash that you're missing. For
the error that you just got, the base uri should be : /server.php/
Evert
--
You received this message because you are subscribed to the Google Groups "SabreDAV Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sabredav-discuss+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sabredav-discuss/3ca5ab90-3270-4905-828f-273f657d69ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Evert Pot
2017-01-02 19:49:14 UTC
Permalink
Post by WG
Hi Evert!
Thank you so much for your help. Settings the baseUri to '/server.php/'
in server.php didn't help. I still got the same error. But setting the
baseUri to '/calendarserver.php/' in calendarserver.php did the job.
Only one of those two files should exist. They both likely have the same
purpose, so I'd recommend deleting the one you're not using.

Evert
--
You received this message because you are subscribed to the Google Groups "SabreDAV Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sabredav-discuss+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sabredav-discuss/d879dd03-c851-6cb1-7de9-77301d571caa%40evertpot.com.
For more options, visit https://groups.google.com/d/optout.
Loading...