Beautified nginx / apache templates

This commit is contained in:
earnolmartin 2023-07-13 10:51:50 -06:00
parent 458cba3372
commit dc55928411
32 changed files with 855 additions and 890 deletions

View file

@ -33,20 +33,20 @@
</Files>
<Location "/extplorer">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/var/www:/usr/share/php:/usr/share/pear; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/var/www:/usr/share/php:/usr/share/pear; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/lib/roundcube:/etc/roundcube:/usr/share:/tmp:/var/www/php_sessions:/var/log/roundcube; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/lib/roundcube:/etc/roundcube:/usr/share:/tmp:/var/www/php_sessions:/var/log/roundcube; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail2">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}/webmail2; \n upload_tmp_dir={ehcpdir}/webmail2/data; \n session.save_path={ehcpdir}/webmail2/data;"
</Location>
<Location "/webmail2">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}/webmail2; \n upload_tmp_dir={ehcpdir}/webmail2/data; \n session.save_path={ehcpdir}/webmail2/data;"
</Location>
<Location "/phpmyadmin">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/phpmyadmin">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
</VirtualHost>
# END OF CUSTOM GLOBAL PANEL URLS Template

View file

@ -33,20 +33,20 @@
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/usr/share/php:/usr/share/pear; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
<Location "/extplorer">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/var/www:/usr/share/php:/usr/share/pear; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/var/www:/usr/share/php:/usr/share/pear; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/lib/roundcube:/etc/roundcube:/usr/share:/tmp:/var/www/php_sessions:/var/log/roundcube; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/lib/roundcube:/etc/roundcube:/usr/share:/tmp:/var/www/php_sessions:/var/log/roundcube; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail2">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}/webmail2; \n upload_tmp_dir={ehcpdir}/webmail2/data; \n session.save_path={ehcpdir}/webmail2/data;"
</Location>
<Location "/webmail2">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}/webmail2; \n upload_tmp_dir={ehcpdir}/webmail2/data; \n session.save_path={ehcpdir}/webmail2/data;"
</Location>
<Location "/phpmyadmin">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/phpmyadmin">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
</VirtualHost>
# END OF CUSTOM GLOBAL PANEL URLS Template

View file

@ -1,8 +1,8 @@
# this file used in Easy Hosting Control Panel (ehcp), www.ehcp.net
<VirtualHost *>
ServerName {domainname}
ServerAlias www.{domainname} *.{domainname}
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) {domainname_redirect}%{REQUEST_URI}
ServerName {domainname}
ServerAlias www.{domainname} *.{domainname}
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) {domainname_redirect}%{REQUEST_URI}
</VirtualHost>

View file

@ -2,7 +2,7 @@
<VirtualHost *:80>
ServerName {domainname}
ServerAlias {domainname_alias}
RewriteEngine On
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>
@ -41,20 +41,20 @@
</Files>
<Location "/extplorer">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/var/www:/usr/share/php:/usr/share/pear; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/var/www:/usr/share/php:/usr/share/pear; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/lib/roundcube:/etc/roundcube:/usr/share:/tmp:/var/www/php_sessions:/var/log/roundcube; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/lib/roundcube:/etc/roundcube:/usr/share:/tmp:/var/www/php_sessions:/var/log/roundcube; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail2">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}/webmail2; \n upload_tmp_dir={ehcpdir}/webmail2/data; \n session.save_path={ehcpdir}/webmail2/data;"
</Location>
<Location "/webmail2">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}/webmail2; \n upload_tmp_dir={ehcpdir}/webmail2/data; \n session.save_path={ehcpdir}/webmail2/data;"
</Location>
<Location "/phpmyadmin">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/phpmyadmin">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
SSLEngine on
SSLCertificateFile {ssl_cert_path}

View file

@ -1,21 +1,21 @@
# this file used in Easy Hosting Control Panel (ehcp), www.ehcp.net
<VirtualHost *:80>
ServerName {domainname}
ServerAlias www.{domainname} *.{domainname}
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) {domainname_redirect}%{REQUEST_URI}
ServerName {domainname}
ServerAlias www.{domainname} *.{domainname}
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) {domainname_redirect}%{REQUEST_URI}
</VirtualHost>
# FOR SSL CONFIG
<VirtualHost *:443>
ServerName {domainname}
ServerAlias www.{domainname} *.{domainname}
SSLEngine on
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) {domainname_redirect}%{REQUEST_URI}
ServerName {domainname}
ServerAlias www.{domainname} *.{domainname}
SSLEngine on
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) {domainname_redirect}%{REQUEST_URI}
</VirtualHost>

View file

@ -33,20 +33,20 @@
</Files>
<Location "/extplorer">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/var/www:/usr/share/php:/usr/share/pear; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/var/www:/usr/share/php:/usr/share/pear; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/lib/roundcube:/etc/roundcube:/usr/share:/tmp:/var/www/php_sessions:/var/log/roundcube; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/var/lib/roundcube:/etc/roundcube:/usr/share:/tmp:/var/www/php_sessions:/var/log/roundcube; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/webmail2">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}/webmail2; \n upload_tmp_dir={ehcpdir}/webmail2/data; \n session.save_path={ehcpdir}/webmail2/data;"
</Location>
<Location "/webmail2">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir={ehcpdir}/webmail2; \n upload_tmp_dir={ehcpdir}/webmail2/data; \n session.save_path={ehcpdir}/webmail2/data;"
</Location>
<Location "/phpmyadmin">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
<Location "/phpmyadmin">
ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions; \n upload_tmp_dir=/tmp; \n session.save_path=/var/www/php_sessions;"
</Location>
SSLEngine on
SSLCertificateFile {ssl_cert_path}

View file

@ -1,12 +1,12 @@
# this file used in Easy Hosting Control Panel (ehcp), www.ehcp.net
<VirtualHost *:443>
ServerName {domainname}
ServerAlias www.{domainname} *.{domainname}
SSLEngine on
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) {domainname_redirect}%{REQUEST_URI}
ServerName {domainname}
ServerAlias www.{domainname} *.{domainname}
SSLEngine on
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) {domainname_redirect}%{REQUEST_URI}
</VirtualHost>

View file

@ -14,7 +14,7 @@ server {
index index.html index.htm index.php;
if ($bad_bot) { return 444; }
if ($bad_referer) { return 403; }
if ($bad_referer) { return 403; }
location / {
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 495 496 497 500 501 502 503 504 505 506 507 /error_page.html;

View file

@ -15,7 +15,7 @@ server {
index index.html index.htm index.php;
if ($bad_bot) { return 444; }
if ($bad_referer) { return 403; }
if ($bad_referer) { return 403; }
location / {
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 495 496 497 500 501 502 503 504 505 506 507 /error_page.html;

View file

@ -1,66 +1,66 @@
# START OF CUSTOM GLOBAL PANEL URLS Template
server {
listen 80;
server_name {domainname};
listen 80;
server_name {domainname};
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
root {ehcpdir};
index index.php;
root {ehcpdir};
index index.php;
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
location / {
location ~ ^/(.+\.conf)$ {
return 403;
}
location ~ ^/(.+\.txt)$ {
return 403;
}
location ~ ^/(.+\.log)$ {
return 403;
}
location ~ ^/(.+\.sh)$ {
return 403;
}
location / {
location ~ ^/(.+\.conf)$ {
return 403;
}
location ~ \.php$ {
root {ehcpdir};
include fastcgi_params;
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
fastcgi_read_timeout 300;
limit_req zone=one burst=5;
location ~ ^/(.+\.txt)$ {
return 403;
}
location ~ ^/(.+\.log)$ {
return 403;
}
location ~ ^/(.+\.sh)$ {
return 403;
}
}
location /phpmyadmin/ {
location ~ \.php$ {
root {ehcpdir};
include fastcgi_params;
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
fastcgi_read_timeout 300;
limit_req zone=one burst=5;
}
location /phpmyadmin/ {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
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:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /webmail2/ {
root {ehcpdir}/;
@ -82,10 +82,6 @@ server {
}
}
location /webmail/ {
rewrite ^/* /roundcube last;
}
location /roundcube/ {
root /usr/share/;
index index.php index.html index.htm;

View file

@ -2,86 +2,85 @@
# nginx default server config file
server {
listen 80 default;
server_name _;
listen 80 default;
server_name _;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
root /var/www/new;
index index.html index.htm index.php;
root /var/www/new;
index index.html index.htm index.php;
# Set this to off if you're hosting more than one site
server_name_in_redirect off;
# Set this to off if you're hosting more than one site
server_name_in_redirect off;
# SEO friendly URLs for Wordpress
#
#location /wordpress/ {
# if (!-e $request_filename) {
# rewrite ^(.*)$ /wordpress/index.php?q=$1 last;
# }
#}
# SEO friendly URLs for Wordpress
#
#location /wordpress/ {
# if (!-e $request_filename) {
# rewrite ^(.*)$ /wordpress/index.php?q=$1 last;
# }
#}
#error_page 404 /404.html;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/new$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/var/www:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include fastcgi_params;
limit_req zone=one burst=5;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/new$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/var/www:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include fastcgi_params;
limit_req zone=one burst=5;
}
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
location /ehcp {
location ~ ^/ehcp/(.+\.conf)$ {
return 403;
}
location ~ ^/ehcp/(.+\.txt)$ {
return 403;
}
location ~ ^/ehcp/(.+\.log)$ {
return 403;
}
location ~ ^/ehcp/(.+\.sh)$ {
return 403;
}
location /ehcp {
location ~ ^/ehcp/(.+\.conf)$ {
return 403;
}
location ~ ^/ehcp/(.+\.txt)$ {
return 403;
}
location ~ ^/ehcp/(.+\.log)$ {
return 403;
}
location ~ ^/ehcp/(.+\.sh)$ {
return 403;
}
}
location /phpmyadmin {
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
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:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
}

View file

@ -4,57 +4,57 @@
user {wwwuser} {wwwgroup};
worker_processes 4;
error_log /var/log/nginx/default.error.log;
error_log /var/log/nginx/default.error.log;
pid /var/run/nginx.pid;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
worker_connections 1024;
}
http {
server_names_hash_bucket_size 4096;
variables_hash_max_size 4096;
variables_hash_bucket_size 4096;
variables_hash_bucket_size 4096;
types_hash_max_size 4096;
limit_req_zone $binary_remote_addr zone=one:20m rate=10r/s;
include /etc/nginx/mime.types;
#default_type application/octet-stream;
default_type text/html;
include /etc/nginx/mime.types;
#default_type application/octet-stream;
default_type text/html;
log_format combined_host '$remote_addr - $remote_user [$time_local] '
log_format combined_host '$remote_addr - $remote_user [$time_local] '
'"$host" "$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log /var/log/nginx/default.access.log;
access_log /var/log/nginx/default.access.log;
sendfile on;
#tcp_nopush on;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 3;
tcp_nodelay on;
#keepalive_timeout 0;
keepalive_timeout 3;
tcp_nodelay on;
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# Nginx default value was 1 MB and therefore all uploads exceeding 1 MB was
# getting "413 Request Entity Too Large" error.Script default is 64 MB.
# Remember to change the settings for upload size in php.ini as well.
client_max_body_size 64m;
# Nginx default value was 1 MB and therefore all uploads exceeding 1 MB was
# getting "413 Request Entity Too Large" error.Script default is 64 MB.
# Remember to change the settings for upload size in php.ini as well.
client_max_body_size 64m;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
include /var/www/new/ehcp/apachehcp.conf;
include /var/www/new/ehcp/apachehcp_subdomains.conf;
include /var/www/new/ehcp/apachehcp_globalpanelurls.conf;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
include /var/www/new/ehcp/apachehcp.conf;
include /var/www/new/ehcp/apachehcp_subdomains.conf;
include /var/www/new/ehcp/apachehcp_globalpanelurls.conf;
##########################
# Nginx Bad Bot Blocker #
##########################
include nginx-badbot-blocker/blacklist.conf;
include nginx-badbot-blocker/blockips.conf;
##########################
# Nginx Bad Bot Blocker #
##########################
include nginx-badbot-blocker/blacklist.conf;
include nginx-badbot-blocker/blockips.conf;
}

View file

@ -14,7 +14,7 @@ server {
index index.html index.htm index.php;
if ($bad_bot) { return 444; }
if ($bad_referer) { return 403; }
if ($bad_referer) { return 403; }
location / {
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 495 496 497 500 501 502 503 504 505 506 507 /error_page.html;

View file

@ -15,7 +15,7 @@ server {
index index.html index.htm index.php;
if ($bad_bot) { return 444; }
if ($bad_referer) { return 403; }
if ($bad_referer) { return 403; }
location / {
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 495 496 497 500 501 502 503 504 505 506 507 /error_page.html;
@ -76,10 +76,6 @@ server {
}
}
location /webmail/ {
rewrite ^/* /roundcube last;
}
location /ehcp/ {
root /var/www/new/;
index index.php index.html index.htm;

View file

@ -1,67 +1,66 @@
# START OF CUSTOM GLOBAL PANEL URLS Template
server {
listen 80;
server_name {domainname};
listen 80;
server_name {domainname};
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
root {ehcpdir};
index index.php;
root {ehcpdir};
index index.php;
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
location / {
location ~ ^/(.+\.conf)$ {
return 403;
}
location ~ ^/(.+\.txt)$ {
return 403;
}
location ~ ^/(.+\.log)$ {
return 403;
}
location ~ ^/(.+\.sh)$ {
return 403;
}
location / {
location ~ ^/(.+\.conf)$ {
return 403;
}
location ~ \.php$ {
root {ehcpdir};
include fastcgi_params;
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
fastcgi_read_timeout 300;
limit_req zone=one burst=5;
location ~ ^/(.+\.txt)$ {
return 403;
}
location ~ ^/(.+\.log)$ {
return 403;
}
location ~ ^/(.+\.sh)$ {
return 403;
}
}
location /phpmyadmin/ {
location ~ \.php$ {
root {ehcpdir};
include fastcgi_params;
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
fastcgi_read_timeout 300;
limit_req zone=one burst=5;
}
location /phpmyadmin/ {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
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:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /webmail2/ {
root {ehcpdir}/;
@ -83,10 +82,6 @@ server {
}
}
location /webmail/ {
rewrite ^/* /roundcube last;
}
location /roundcube/ {
root /usr/share/;
index index.php index.html index.htm;

View file

@ -2,86 +2,85 @@
# nginx default server config file
server {
listen 80 default;
server_name _;
listen 80 default;
server_name _;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
root /var/www/new;
index index.html index.htm index.php;
root /var/www/new;
index index.html index.htm index.php;
# Set this to off if you're hosting more than one site
server_name_in_redirect off;
# Set this to off if you're hosting more than one site
server_name_in_redirect off;
# SEO friendly URLs for Wordpress
#
#location /wordpress/ {
# if (!-e $request_filename) {
# rewrite ^(.*)$ /wordpress/index.php?q=$1 last;
# }
#}
# SEO friendly URLs for Wordpress
#
#location /wordpress/ {
# if (!-e $request_filename) {
# rewrite ^(.*)$ /wordpress/index.php?q=$1 last;
# }
#}
#error_page 404 /404.html;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/new$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/var/www:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include fastcgi_params;
limit_req zone=one burst=5;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/new$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/var/www:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include fastcgi_params;
limit_req zone=one burst=5;
}
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
location /ehcp {
location ~ ^/ehcp/(.+\.conf)$ {
return 403;
}
location ~ ^/ehcp/(.+\.txt)$ {
return 403;
}
location ~ ^/ehcp/(.+\.log)$ {
return 403;
}
location ~ ^/ehcp/(.+\.sh)$ {
return 403;
}
location /ehcp {
location ~ ^/ehcp/(.+\.conf)$ {
return 403;
}
location ~ ^/ehcp/(.+\.txt)$ {
return 403;
}
location ~ ^/ehcp/(.+\.log)$ {
return 403;
}
location ~ ^/ehcp/(.+\.sh)$ {
return 403;
}
}
location /phpmyadmin {
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
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:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
}

View file

@ -4,57 +4,57 @@
user {wwwuser} {wwwgroup};
worker_processes 4;
error_log /var/log/nginx/default.error.log;
error_log /var/log/nginx/default.error.log;
pid /var/run/nginx.pid;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
worker_connections 1024;
}
http {
server_names_hash_bucket_size 4096;
variables_hash_max_size 4096;
variables_hash_bucket_size 4096;
variables_hash_bucket_size 4096;
types_hash_max_size 4096;
limit_req_zone $binary_remote_addr zone=one:20m rate=10r/s;
include /etc/nginx/mime.types;
#default_type application/octet-stream;
default_type text/html;
include /etc/nginx/mime.types;
#default_type application/octet-stream;
default_type text/html;
log_format combined_host '$remote_addr - $remote_user [$time_local] '
log_format combined_host '$remote_addr - $remote_user [$time_local] '
'"$host" "$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log /var/log/nginx/default.access.log;
access_log /var/log/nginx/default.access.log;
sendfile on;
#tcp_nopush on;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 3;
tcp_nodelay on;
#keepalive_timeout 0;
keepalive_timeout 3;
tcp_nodelay on;
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# Nginx default value was 1 MB and therefore all uploads exceeding 1 MB was
# getting "413 Request Entity Too Large" error.Script default is 64 MB.
# Remember to change the settings for upload size in php.ini as well.
client_max_body_size 64m;
# Nginx default value was 1 MB and therefore all uploads exceeding 1 MB was
# getting "413 Request Entity Too Large" error.Script default is 64 MB.
# Remember to change the settings for upload size in php.ini as well.
client_max_body_size 64m;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
include /var/www/new/ehcp/apachehcp.conf;
include /var/www/new/ehcp/apachehcp_subdomains.conf;
include /var/www/new/ehcp/apachehcp_globalpanelurls.conf;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
include /var/www/new/ehcp/apachehcp.conf;
include /var/www/new/ehcp/apachehcp_subdomains.conf;
include /var/www/new/ehcp/apachehcp_globalpanelurls.conf;
##########################
# Nginx Bad Bot Blocker #
##########################
include nginx-badbot-blocker/blacklist.conf;
include nginx-badbot-blocker/blockips.conf;
##########################
# Nginx Bad Bot Blocker #
##########################
include nginx-badbot-blocker/blacklist.conf;
include nginx-badbot-blocker/blockips.conf;
}

View file

@ -14,7 +14,7 @@ server {
index index.html index.htm index.php;
if ($bad_bot) { return 444; }
if ($bad_referer) { return 403; }
if ($bad_referer) { return 403; }
location / {
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 495 496 497 500 501 502 503 504 505 506 507 /error_page.html;
@ -66,7 +66,7 @@ server {
index index.html index.htm index.php;
if ($bad_bot) { return 444; }
if ($bad_referer) { return 403; }
if ($bad_referer) { return 403; }
location / {
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 495 496 497 500 501 502 503 504 505 506 507 /error_page.html;

View file

@ -15,7 +15,7 @@ server {
index index.html index.htm index.php;
if ($bad_bot) { return 444; }
if ($bad_referer) { return 403; }
if ($bad_referer) { return 403; }
location / {
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 495 496 497 500 501 502 503 504 505 506 507 /error_page.html;
@ -79,10 +79,6 @@ server {
}
}
location /webmail/ {
rewrite ^/* /roundcube last;
}
location /ehcp/ {
root /var/www/new/;
index index.php index.html index.htm;
@ -200,7 +196,7 @@ server {
index index.html index.htm index.php;
if ($bad_bot) { return 444; }
if ($bad_referer) { return 403; }
if ($bad_referer) { return 403; }
location / {
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 495 496 497 500 501 502 503 504 505 506 507 /error_page.html;
@ -264,10 +260,6 @@ server {
}
}
location /webmail/ {
rewrite ^/* /roundcube last;
}
location /ehcp/ {
root /var/www/new/;
index index.php index.html index.htm;

View file

@ -10,72 +10,72 @@ server {
# FOR SSL CONFIG
server {
listen 443 ssl;
server_name {domainname};
listen 443 ssl;
server_name {domainname};
ssl_certificate {ssl_cert_path};
ssl_certificate_key {ssl_cert_key_path};
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_certificate {ssl_cert_path};
ssl_certificate_key {ssl_cert_key_path};
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
root {ehcpdir};
index index.php;
root {ehcpdir};
index index.php;
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
location / {
location ~ ^/(.+\.conf)$ {
return 403;
}
location ~ ^/(.+\.txt)$ {
return 403;
}
location ~ ^/(.+\.log)$ {
return 403;
}
location ~ ^/(.+\.sh)$ {
return 403;
}
location / {
location ~ ^/(.+\.conf)$ {
return 403;
}
location ~ \.php$ {
root {ehcpdir};
include fastcgi_params;
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
fastcgi_read_timeout 300;
limit_req zone=one burst=5;
location ~ ^/(.+\.txt)$ {
return 403;
}
location ~ ^/(.+\.log)$ {
return 403;
}
location ~ ^/(.+\.sh)$ {
return 403;
}
}
location /phpmyadmin/ {
location ~ \.php$ {
root {ehcpdir};
include fastcgi_params;
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
fastcgi_read_timeout 300;
limit_req zone=one burst=5;
}
location /phpmyadmin/ {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
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:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /webmail2/ {
root {ehcpdir}/;
@ -97,11 +97,7 @@ server {
}
}
location /webmail/ {
rewrite ^/* /roundcube last;
}
location /roundcube {
location /roundcube/ {
root /usr/share/;
index index.php index.html index.htm;

View file

@ -2,178 +2,179 @@
# nginx default server config file
server {
listen 80 default;
server_name _;
listen 80 default;
server_name _;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
root /var/www/new;
index index.html index.htm index.php;
root /var/www/new;
index index.html index.htm index.php;
# Set this to off if you're hosting more than one site
server_name_in_redirect off;
# Set this to off if you're hosting more than one site
server_name_in_redirect off;
# SEO friendly URLs for Wordpress
#
#location /wordpress/ {
# if (!-e $request_filename) {
# rewrite ^(.*)$ /wordpress/index.php?q=$1 last;
# }
#}
# SEO friendly URLs for Wordpress
#
#location /wordpress/ {
# if (!-e $request_filename) {
# rewrite ^(.*)$ /wordpress/index.php?q=$1 last;
# }
#}
#error_page 404 /404.html;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/new$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/var/www:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include fastcgi_params;
limit_req zone=one burst=5;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/new$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/var/www:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include fastcgi_params;
limit_req zone=one burst=5;
}
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
location /ehcp {
location ~ ^/ehcp/(.+\.conf)$ {
return 403;
}
location ~ ^/ehcp/(.+\.txt)$ {
return 403;
}
location ~ ^/ehcp/(.+\.log)$ {
return 403;
}
location ~ ^/ehcp/(.+\.sh)$ {
return 403;
}
location /ehcp {
location ~ ^/ehcp/(.+\.conf)$ {
return 403;
}
location ~ ^/ehcp/(.+\.txt)$ {
return 403;
}
location ~ ^/ehcp/(.+\.log)$ {
return 403;
}
location ~ ^/ehcp/(.+\.sh)$ {
return 403;
}
}
location /phpmyadmin {
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
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:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
}
# For SSL CONFIG
server {
listen 443 ssl;
server_name _;
listen 443 ssl;
server_name _;
ssl_certificate /etc/ssl/certs/server.crt;
ssl_certificate_key /etc/ssl/private/server.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_certificate /etc/ssl/certs/server.crt;
ssl_certificate_key /etc/ssl/private/server.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
root /var/www/new;
index index.html index.htm index.php;
root /var/www/new;
index index.html index.htm index.php;
# Set this to off if you're hosting more than one site
server_name_in_redirect off;
# Set this to off if you're hosting more than one site
server_name_in_redirect off;
# SEO friendly URLs for Wordpress
#
#location /wordpress/ {
# if (!-e $request_filename) {
# rewrite ^(.*)$ /wordpress/index.php?q=$1 last;
# }
#}
# SEO friendly URLs for Wordpress
#
#location /wordpress/ {
# if (!-e $request_filename) {
# rewrite ^(.*)$ /wordpress/index.php?q=$1 last;
# }
#}
#error_page 404 /404.html;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/new$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/var/www:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include fastcgi_params;
limit_req zone=one burst=5;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/new$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/var/www:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include fastcgi_params;
limit_req zone=one burst=5;
}
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
location /ehcp {
location ~ ^/ehcp/(.+\.conf)$ {
return 403;
}
location ~ ^/ehcp/(.+\.txt)$ {
return 403;
}
location ~ ^/ehcp/(.+\.log)$ {
return 403;
}
location ~ ^/ehcp/(.+\.sh)$ {
return 403;
}
location /ehcp {
location ~ ^/ehcp/(.+\.conf)$ {
return 403;
}
location ~ ^/ehcp/(.+\.txt)$ {
return 403;
}
location ~ ^/ehcp/(.+\.log)$ {
return 403;
}
location ~ ^/ehcp/(.+\.sh)$ {
return 403;
}
}
location /phpmyadmin {
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
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:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
}

View file

@ -5,55 +5,55 @@ user {wwwuser} {wwwgroup};
worker_processes 4;
error_log /var/log/nginx/default.error.log;
pid /var/run/nginx.pid;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
worker_connections 1024;
}
http {
server_names_hash_bucket_size 4096;
variables_hash_max_size 4096;
variables_hash_bucket_size 4096;
variables_hash_bucket_size 4096;
types_hash_max_size 4096;
limit_req_zone $binary_remote_addr zone=one:20m rate=10r/s;
include /etc/nginx/mime.types;
#default_type application/octet-stream;
default_type text/html;
include /etc/nginx/mime.types;
#default_type application/octet-stream;
default_type text/html;
log_format combined_host '$remote_addr - $remote_user [$time_local] '
log_format combined_host '$remote_addr - $remote_user [$time_local] '
'"$host" "$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log /var/log/nginx/default.access.log;
access_log /var/log/nginx/default.access.log;
sendfile on;
#tcp_nopush on;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 3;
tcp_nodelay on;
#keepalive_timeout 0;
keepalive_timeout 3;
tcp_nodelay on;
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# Nginx default value was 1 MB and therefore all uploads exceeding 1 MB was
# getting "413 Request Entity Too Large" error.Script default is 64 MB.
# Remember to change the settings for upload size in php.ini as well.
client_max_body_size 64m;
# Nginx default value was 1 MB and therefore all uploads exceeding 1 MB was
# getting "413 Request Entity Too Large" error.Script default is 64 MB.
# Remember to change the settings for upload size in php.ini as well.
client_max_body_size 64m;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
include /var/www/new/ehcp/apachehcp.conf;
include /var/www/new/ehcp/apachehcp_subdomains.conf;
include /var/www/new/ehcp/apachehcp_globalpanelurls.conf;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
include /var/www/new/ehcp/apachehcp.conf;
include /var/www/new/ehcp/apachehcp_subdomains.conf;
include /var/www/new/ehcp/apachehcp_globalpanelurls.conf;
##########################
# Nginx Bad Bot Blocker #
##########################
include nginx-badbot-blocker/blacklist.conf;
include nginx-badbot-blocker/blockips.conf;
##########################
# Nginx Bad Bot Blocker #
##########################
include nginx-badbot-blocker/blacklist.conf;
include nginx-badbot-blocker/blockips.conf;
}

View file

@ -19,7 +19,7 @@ server {
index index.html index.htm index.php;
if ($bad_bot) { return 444; }
if ($bad_referer) { return 403; }
if ($bad_referer) { return 403; }
location / {
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 495 496 497 500 501 502 503 504 505 506 507 /error_page.html;

View file

@ -21,7 +21,7 @@ server {
index index.html index.htm index.php;
if ($bad_bot) { return 444; }
if ($bad_referer) { return 403; }
if ($bad_referer) { return 403; }
location / {
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 495 496 497 500 501 502 503 504 505 506 507 /error_page.html;
@ -43,7 +43,6 @@ server {
limit_req zone=one burst=5;
}
location /phpmyadmin/ {
root /usr/share/;
index index.php index.html index.htm;
@ -86,10 +85,6 @@ server {
}
}
location /webmail/ {
rewrite ^/* /roundcube last;
}
location /ehcp/ {
root /var/www/new/;
index index.php index.html index.htm;

View file

@ -1,71 +1,71 @@
# START OF CUSTOM GLOBAL PANEL URLS Template
server {
listen 443 ssl;
server_name {domainname};
listen 443 ssl;
server_name {domainname};
ssl_certificate {ssl_cert_path};
ssl_certificate_key {ssl_cert_key_path};
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_certificate {ssl_cert_path};
ssl_certificate_key {ssl_cert_key_path};
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
root {ehcpdir};
index index.php;
root {ehcpdir};
index index.php;
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
location / {
location ~ ^/(.+\.conf)$ {
return 403;
}
location ~ ^/(.+\.txt)$ {
return 403;
}
location ~ ^/(.+\.log)$ {
return 403;
}
location ~ ^/(.+\.sh)$ {
return 403;
}
location / {
location ~ ^/(.+\.conf)$ {
return 403;
}
location ~ \.php$ {
root {ehcpdir};
include fastcgi_params;
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
fastcgi_read_timeout 300;
limit_req zone=one burst=5;
location ~ ^/(.+\.txt)$ {
return 403;
}
location ~ ^/(.+\.log)$ {
return 403;
}
location ~ ^/(.+\.sh)$ {
return 403;
}
}
location /phpmyadmin/ {
location ~ \.php$ {
root {ehcpdir};
include fastcgi_params;
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir={ehcpdir}:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
fastcgi_read_timeout 300;
limit_req zone=one burst=5;
}
location /phpmyadmin/ {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
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:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /webmail2/ {
root {ehcpdir}/;
@ -87,10 +87,6 @@ server {
}
}
location /webmail/ {
rewrite ^/* /roundcube last;
}
location /roundcube/ {
root /usr/share/;
index index.php index.html index.htm;

View file

@ -2,98 +2,98 @@
# nginx default server config file
server {
listen 80;
return 301 https://$host$request_uri;
listen 80;
return 301 https://$host$request_uri;
}
# For SSL CONFIG
server {
listen 443 ssl;
server_name _;
listen 443 ssl;
server_name _;
ssl_certificate /etc/ssl/certs/server.crt;
ssl_certificate_key /etc/ssl/private/server.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_certificate /etc/ssl/certs/server.crt;
ssl_certificate_key /etc/ssl/private/server.key;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
access_log /var/log/nginx/default.access.log;
error_log /var/log/nginx/default.error.log;
root /var/www/new;
index index.html index.htm index.php;
root /var/www/new;
index index.html index.htm index.php;
# Set this to off if you're hosting more than one site
server_name_in_redirect off;
# Set this to off if you're hosting more than one site
server_name_in_redirect off;
# SEO friendly URLs for Wordpress
#
#location /wordpress/ {
# if (!-e $request_filename) {
# rewrite ^(.*)$ /wordpress/index.php?q=$1 last;
# }
#}
# SEO friendly URLs for Wordpress
#
#location /wordpress/ {
# if (!-e $request_filename) {
# rewrite ^(.*)$ /wordpress/index.php?q=$1 last;
# }
#}
#error_page 404 /404.html;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/nginx-default;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/new$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/var/www:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include fastcgi_params;
limit_req zone=one burst=5;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/new$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/var/www:/tmp:/usr/share:/etc/roundcube:/var/lib/roundcube:/var/log/roundcube \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include fastcgi_params;
limit_req zone=one burst=5;
}
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
# deny access to .htaccess files, if Apache's document root concurs with nginx's one
#
location ~ (apache_subdomain_template|apachetemplate$|apachetemplate_ipbased|apachetemplate_passivedomains|/\.conf$|/\.ht|access_log|error_log|access\.log|error\.log) {
deny all;
}
location /ehcp {
location ~ ^/ehcp/(.+\.conf)$ {
return 403;
}
location ~ ^/ehcp/(.+\.txt)$ {
return 403;
}
location ~ ^/ehcp/(.+\.log)$ {
return 403;
}
location ~ ^/ehcp/(.+\.sh)$ {
return 403;
}
location /ehcp {
location ~ ^/ehcp/(.+\.conf)$ {
return 403;
}
location ~ ^/ehcp/(.+\.txt)$ {
return 403;
}
location ~ ^/ehcp/(.+\.log)$ {
return 403;
}
location ~ ^/ehcp/(.+\.sh)$ {
return 403;
}
}
location /phpmyadmin {
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
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:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/usr/share/phpmyadmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/tmp:/usr/share/php:/usr/share/pear:/usr/share:/var/www/php_sessions \n upload_tmp_dir=/tmp \n session.save_path=/var/www/php_sessions";
include /etc/nginx/fastcgi_params;
limit_req zone=one burst=5;
proxy_send_timeout 600;
proxy_read_timeout 600;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
}

View file

@ -5,55 +5,55 @@ user {wwwuser} {wwwgroup};
worker_processes 4;
error_log /var/log/nginx/default.error.log;
pid /var/run/nginx.pid;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
worker_connections 1024;
}
http {
server_names_hash_bucket_size 4096;
variables_hash_max_size 4096;
variables_hash_bucket_size 4096;
types_hash_max_size 4096;
server_names_hash_bucket_size 4096;
variables_hash_max_size 4096;
variables_hash_bucket_size 4096;
types_hash_max_size 4096;
limit_req_zone $binary_remote_addr zone=one:20m rate=10r/s;
include /etc/nginx/mime.types;
#default_type application/octet-stream;
default_type text/html;
include /etc/nginx/mime.types;
#default_type application/octet-stream;
default_type text/html;
log_format combined_host '$remote_addr - $remote_user [$time_local] '
log_format combined_host '$remote_addr - $remote_user [$time_local] '
'"$host" "$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
access_log /var/log/nginx/default.access.log;
access_log /var/log/nginx/default.access.log;
sendfile on;
#tcp_nopush on;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 3;
tcp_nodelay on;
#keepalive_timeout 0;
keepalive_timeout 3;
tcp_nodelay on;
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# Nginx default value was 1 MB and therefore all uploads exceeding 1 MB was
# getting "413 Request Entity Too Large" error.Script default is 64 MB.
# Remember to change the settings for upload size in php.ini as well.
client_max_body_size 64m;
# Nginx default value was 1 MB and therefore all uploads exceeding 1 MB was
# getting "413 Request Entity Too Large" error.Script default is 64 MB.
# Remember to change the settings for upload size in php.ini as well.
client_max_body_size 64m;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
include /var/www/new/ehcp/apachehcp.conf;
include /var/www/new/ehcp/apachehcp_subdomains.conf;
include /var/www/new/ehcp/apachehcp_globalpanelurls.conf;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
include /var/www/new/ehcp/apachehcp.conf;
include /var/www/new/ehcp/apachehcp_subdomains.conf;
include /var/www/new/ehcp/apachehcp_globalpanelurls.conf;
##########################
# Nginx Bad Bot Blocker #
##########################
include nginx-badbot-blocker/blacklist.conf;
include nginx-badbot-blocker/blockips.conf;
##########################
# Nginx Bad Bot Blocker #
##########################
include nginx-badbot-blocker/blacklist.conf;
include nginx-badbot-blocker/blockips.conf;
}