Special web servers (Apache2/nginx) configs

This commit is contained in:
RainLoop Team 2013-12-26 03:54:16 +04:00
parent e1adfdb504
commit fde3e8241e
5 changed files with 120 additions and 65 deletions

View file

@ -0,0 +1,16 @@
<VirtualHost *:80>
AcceptPathInfo On
ServerName dav.mydomain.com
DocumentRoot /var/www/mydomain.com
RewriteEngine On
RewriteRule /.well-known/carddav /index.php/dav [R,L]
<Directory "/var/www/mydomain.com">
Options None
Options +FollowSymlinks
AllowOverride All
</Directory>
</VirtualHost>

View file

@ -0,0 +1,16 @@
<VirtualHost *:80>
AcceptPathInfo On
ServerName mydomain.com
DocumentRoot /var/www/mydomain.com
RewriteEngine On
RewriteRule /.well-known/carddav /index.php/dav [R,L]
<Directory "/var/www/mydomain.com">
Options None
Options +FollowSymlinks
AllowOverride All
</Directory>
</VirtualHost>

View file

@ -1,65 +0,0 @@
server {
listen 80;
server_name domain.com;
root /var/www/domain.com;
index index.php index.html;
log_not_found off;
charset utf-8;
error_log /var/log/nginx/domain.com-error.log;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\.ht { deny all; }
location ^~ /data {
deny all;
return 404;
}
rewrite ^/.well-known/carddav /index.php/dav/ redirect;
location ~ ^(.+\.php)(.*)$ {
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/[^?]*).*$;
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
# optional
server {
listen 80;
server_name dav.domain.com;
rewrite ^/.well-known/carddav / redirect;
root /var/www/domain.com;
index index.php index.html;
log_not_found off;
charset utf-8;
error_log /var/log/nginx/dav.domain.com-error.log;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\.ht { deny all; }
rewrite ^/.well-known/carddav / redirect;
rewrite ^(.*)$ /index.php/dav$1 last;
location ~ ^(.+\.php)(.*)$ {
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/[^?]*).*$;
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}

View file

@ -0,0 +1,41 @@
server {
listen 80;
server_name dav.mydomain.com;
root /var/www/mydomain.com;
access_log /var/log/nginx/dav.mydomain.com.access.log main;
error_log /var/log/nginx/dav.mydomain.com.error.log;
index index.php;
charset utf-8;
log_not_found off;
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\.ht { access_log off; log_not_found off; deny all; return 404; }
location ^~ /data { access_log off; log_not_found off; deny all; return 404; }
rewrite ^/.well-known/carddav / redirect;
rewrite ^(.*)$ /index.php/dav$1 last;
location ~ /index\.php/dav/.*$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_split_path_info ^(.+\.php)(/[^?]*).*$;
fastcgi_index index.php;
fastcgi_param SCRIPT_NAME index.php;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
}

View file

@ -0,0 +1,47 @@
server {
listen 80;
server_name mydomain.com;
root /var/www/mydomain.com;
access_log /var/log/nginx/mydomain.com.access.log main;
error_log /var/log/nginx/mydomain.com.error.log;
index index.php index.html;
charset utf-8;
log_not_found off;
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ /\.ht { access_log off; log_not_found off; deny all; return 404; }
location ^~ /data { access_log off; log_not_found off; deny all; return 404; }
rewrite ^/.well-known/carddav /index.php/dav/ redirect;
location ~ /index\.php/dav/.*$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_split_path_info ^(.+\.php)(/[^?]*).*$;
fastcgi_index index.php;
fastcgi_param SCRIPT_NAME index.php;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
}
location ~ \.php {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
# fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}