16-02-2012 Saat: 02:34
nginx template code to enable webmail, roundcube, etc.
to activate this, put in apachetemplate file in ehcp, then, ehcp->options->syncdomains.
to activate this, put in apachetemplate file in ehcp, then, ehcp->options->syncdomains.
Kod:
# this file used in Easy Hosting Control Panel (ehcp), www.ehcp.net
# webserver config file for nginx webserver
server {
listen 80;
server_name {domainname} www.{domainname} {wildcarddomain}; # this is changed to *.{domainname} within classapp.php
access_log {homedir}/logs/access_log;
error_log {homedir}/logs/error_log;
access_log /var/log/apache_common_access_log;
root {homedir}/httpdocs;
index index.html index.htm index.php;
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME {homedir}/httpdocs$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir={homedir}:/tmp:/usr/share/php:/usr/share/pear";
include fastcgi_params;
fastcgi_read_timeout 300;
}
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
location /webmail {
root /var/www/new/ehcp/;
index index.php index.html index.htm;
location ~ ^/webmail/(.+\.php)$ {
try_files $uri =404;
root /var/www/new/ehcp/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
}
location ~* ^/webmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /var/www/new/ehcp/;
}
}
location /roundcube {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/roundcube/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
}
location ~* ^/roundcube/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
# any files that should be avoided, may be put here:
location ~ (apache_subdomain_template|apachetemplate|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
}
server {
listen 80;
server_name mymail.{domainname} www.mymail.{domainname};
root /usr/share/roundcube/;
index index.php index.html index.htm;
location ~ \.php$ {
try_files $uri =404;
root /usr/share/roundcube/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
}
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt|htm)$ {
root /usr/share/roundcube/;
}
}
server {
listen 80;
server_name mail.{domainname} www.mail.{domainname};
root /var/www/new/ehcp/webmail/;
index index.php index.html index.htm;
location ~ \.php$ {
try_files $uri =404;
root /var/www/new/ehcp/webmail/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
}
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt|htm)$ {
root /var/www/new/ehcp/webmail/;
}
}
server{
listen 80;
server_name mysql.{domainname} www.mysql.{domainname};
root /usr/share/phpmyadmin/;
index index.php index.html index.htm;
location ~ \.php$ {
try_files $uri =404;
root /usr/share/phpmyadmin/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
}
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ {
root /usr/share/phpmyadmin/;
}
}
server{
listen 80;
server_name chive.{domainname} www.chive.{domainname};
root /var/www/new/ehcp/chive/;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php;
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
}
location ~ ^(protected|framework|themes/\w+/views) {
deny all;
}
}