Advertisement
Guest User

Untitled

a guest
Nov 25th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.41 KB | None | 0 0
  1. # mailcow site configuration
  2. # ! Do not remove this header !
  3. server {
  4.     listen 80;
  5.     listen [::]:80;
  6.     server_name <internal IP> <Mailcow external hostname e.g. mail.example.com>;
  7.     server_tokens off;
  8.     root /var/www/mail;
  9.  
  10.     client_max_body_size 25m;
  11.     root /var/www/mail;
  12.     index index.html index.htm index.php;
  13.     error_page 502 /redir.html;
  14.  
  15.     location /redir.html {
  16.         return 301 /admin.php;
  17.     }
  18.  
  19.     location ~ ^/(rc/logs)/ {
  20.         deny all;
  21.     }
  22.  
  23.     location ~ /(\.ht) {
  24.         deny all;
  25.         return 404;
  26.     }
  27.  
  28.     location = /favicon.ico {
  29.         log_not_found off;
  30.         access_log off;
  31.     }
  32.  
  33.     location = /robots.txt {
  34.         allow all;
  35.         log_not_found off;
  36.         access_log off;
  37.     }
  38.  
  39.     location / {
  40.         try_files $uri $uri/ index.php;
  41.     }
  42.  
  43.     location ~ \.php$ {
  44.         include fastcgi_params;
  45.         fastcgi_split_path_info ^(.+\.php)(/.+)$;
  46.         fastcgi_pass unix:/var/run/php-mail-fpm.sock;
  47.         fastcgi_index index.php;
  48.         fastcgi_param HTTPS on;
  49.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  50.         fastcgi_read_timeout 630;
  51.         fastcgi_keep_conn on;
  52.     }
  53. }
  54.  
  55. server {
  56.     listen 127.0.0.1:81;
  57.  
  58.     location ~ \.cgi$ {
  59.         root /usr/lib/cgi-bin;
  60.         include /etc/nginx/fastcgi_params;
  61.         fastcgi_pass unix:/var/run/fcgiwrap.socket;
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement