server { ###################################################################### ## Server configuration ###################################################################### # Tell nginx to listen on port (default http(s) port, IPv4) listen :; # Tell nginx to listen on port (default http(s) port, IPv6) listen []: ipv6only=on; server_name ; ###################################################################### ## Log configuration ###################################################################### access_log /var/log/ispconfig/httpd//access.log combined; error_log /var/log/ispconfig/httpd//error.log; ###################################################################### ## SSL configuration ###################################################################### ssl on; ssl_certificate /.nginx.crt; ssl_certificate_key /.nginx.key; ###################################################################### ## Redirects configuration ###################################################################### # SEO Redirect if ($http_host = "") { rewrite ^ $scheme://$request_uri permanent; } # Redirects #if ($http_host ~* "$") { # rewrite ^/(.+)$ $1 ; #} ###################################################################### ## Error configuration ###################################################################### 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; ###################################################################### ## Locations configuration ###################################################################### location / { # disable access log (we already have it for nginx) access_log off; # set the document root root ; # cache apache2's answers in the cache proxy_cache nginx_cache; # pass all requests to apache2 proxy_pass http://:; proxy_pass http://:; } location ~ /\. { # Don't allow any access deny all; # Don't log access access_log off; } ###################################################################### ## Directives configuration ###################################################################### ###################################################################### ## CP configuration ###################################################################### # If domain.tld/ispconfig is requested, redirect to the secure ISPConfig URL location = /ispconfig { rewrite ^ / permanent; } # If domain.tld/phpmyadmin is requested, redirect to the secure phpMyAdmin URL location = /phpmyadmin { rewrite ^ /phpmyadmin/ permanent; } # If domain.tld/webmail is requested, redirect to the secure RoundCube Webmail URL location = /webmail { rewrite ^ /webmail/ permanent; } }