From 7508d70198192aba9678d7dedc446a1ecb127d8b Mon Sep 17 00:00:00 2001 From: Alexandre Alouit Date: Thu, 26 Nov 2015 02:12:51 +0100 Subject: improvement & bugfix use complete files instead patch fix subdomain auto-redirection --- src/server/conf/nginx_vhost.conf.master | 234 ++++++++++++++++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100755 src/server/conf/nginx_vhost.conf.master (limited to 'src/server/conf/nginx_vhost.conf.master') diff --git a/src/server/conf/nginx_vhost.conf.master b/src/server/conf/nginx_vhost.conf.master new file mode 100755 index 0000000..5fce663 --- /dev/null +++ b/src/server/conf/nginx_vhost.conf.master @@ -0,0 +1,234 @@ +server { + listen :80; + + listen []:80; + + + + listen :443 ssl; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + + listen []:443 ssl; + + ssl_certificate /ssl/.crt; + ssl_certificate_key /ssl/.key; + + + server_name ; + + root ; + + + if ($http_host "") { + rewrite ^ $scheme://$request_uri? permanent; + } + + + if ($http_host "") { + rewrite ^ $scheme://$request_uri? permanent; + } + + + if ($http_host "") { + rewrite ^(.*)$ $2 ; + } + + + + + if ($http_host != "") { rewrite ^(.*)$ $2 ; } + + + location / { + proxy_pass ; + rewrite ^/(.*) /$1; + + + + } + + + + index index.html index.htm index.php index.cgi index.pl index.xhtml; + + + location ~ \.shtml$ { + ssi on; + } + + + + error_page 400 /error/400.html; + error_page 401 /error/401.html; + error_page 403 /error/403.html; + error_page 404 /error/404.html; + error_page 405 /error/405.html; + error_page 500 /error/500.html; + error_page 502 /error/502.html; + error_page 503 /error/503.html; + recursive_error_pages on; + location = /error/400.html { + + internal; + } + location = /error/401.html { + + internal; + } + location = /error/403.html { + + internal; + } + location = /error/404.html { + + internal; + } + location = /error/405.html { + + internal; + } + location = /error/500.html { + + internal; + } + location = /error/502.html { + + internal; + } + location = /error/503.html { + + internal; + } + + + error_log /var/log/ispconfig/httpd//error.log; + access_log /var/log/ispconfig/httpd//access.log combined; + + ## Disable .htaccess and other hidden files + + location ~ /\. { + deny all; + access_log off; + log_not_found off; + } + + + location = /favicon.ico { + log_not_found off; + access_log off; + } + + location = /robots.txt { + allow all; + log_not_found off; + access_log off; + } + + location /stats/ { + + index index.html index.php; + auth_basic "Members Only"; + auth_basic_user_file ; + } + + location ^~ /awstats-icon { + alias /usr/share/awstats/icon; + } + + location ~ \.php$ { + try_files @php; + } + + + location @php { + try_files $uri =404; + include /etc/nginx/fastcgi_params; + + fastcgi_pass 127.0.0.1:; + + + fastcgi_pass unix:; + + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + #fastcgi_param PATH_INFO $fastcgi_script_name; + fastcgi_intercept_errors on; + } + + location @php { + deny all; + } + + + + location /cgi-bin/ { + try_files $uri =404; + include /etc/nginx/fastcgi_params; + root ; + gzip off; + fastcgi_pass unix:/var/run/fcgiwrap.socket; + fastcgi_index index.cgi; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_intercept_errors on; + } + + + + + + + + + + + + location { ##merge## + auth_basic "Members Only"; + auth_basic_user_file .htpasswd; + + location ~ \.php$ { + try_files @php; + } + } + + +} + + +server { + listen :80; + + listen []:80; + + + + listen :443 ssl; + + listen []:443 ssl; + + ssl_certificate /ssl/.crt; + ssl_certificate_key /ssl/.key; + + + server_name ; + + + if ($http_host "") { + rewrite ^ $scheme://$request_uri? permanent; + } + + + + rewrite ^ $request_uri? ; + + + location / { + proxy_pass ; + rewrite ^/(.*) /$1; + + + + } + +} + -- cgit v1.2.3