server { listen 8080; server_name webmail.linuxiarz.pl; set $base /var/www/webmail; root $base; # include config/security_roundcube.conf; # restrict methods if ($request_method !~ ^(GET|POST)$) { return '405'; } # index.php index index.php; # index.php fallback location / { try_files $uri $uri/ index.php; } location ~ ^/(README|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ { deny all; error_page 403 =404 / ; } location ~ ^/(bin|SQL|config|temp|logs)/ { deny all; } location ~\.(ini|log|conf|MD|md|json)$ { deny all; error_page 403 =404 / ; } # additional config # include config/general.conf; # handle .php location ~ \.php$ { include config/php_fastcgi_webmail.conf; } } server { listen 443 ssl http2; server_name webmail.linuxiarz.pl; include config/wildcard.conf; # logging access_log /var/log/nginx/webmail.linuxiarz.pl.access.log; error_log /var/log/nginx/webmail.linuxiarz.pl.error.log warn; location / { proxy_pass http://127.0.0.1:6081/; include config/proxy.conf; } } # HTTP redirect server { listen 80; # listen [::]:80; server_name webmail.linuxiarz.pl poczta.linuxiarz.pl poczta.gru.one.pl; location / { return 301 https://webmail.linuxiarz.pl$request_uri; } } # Other redirects server { listen 443 ssl http2; server_name poczta.linuxiarz.pl; include config/wildcard.conf; # security include config/security.conf; # restrict methods if ($request_method !~ ^(GET)$) { return '405'; } location / { return 301 https://webmail.linuxiarz.pl$request_uri; } }