mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-28 08:44:02 +08:00
Special web servers (Apache2/nginx) configs
This commit is contained in:
parent
e1adfdb504
commit
fde3e8241e
5 changed files with 120 additions and 65 deletions
16
build/configs/apache2/dav.mydomain.com
Normal file
16
build/configs/apache2/dav.mydomain.com
Normal 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>
|
16
build/configs/apache2/mydomain.com
Normal file
16
build/configs/apache2/mydomain.com
Normal 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>
|
|
@ -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;
|
||||
}
|
||||
}
|
41
build/configs/nginx/dav.mydomain.com.conf
Normal file
41
build/configs/nginx/dav.mydomain.com.conf
Normal 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;
|
||||
}
|
||||
}
|
47
build/configs/nginx/mydomain.com.conf
Normal file
47
build/configs/nginx/mydomain.com.conf
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue