Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 1.14 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # with this configuration Nginx enforces the access by HTTPS
  2. server {
  3.         server_name webmail.example.com;
  4.         location = / {
  5.                 rewrite ^(.*)$ https://webmail.example.com$1 permanent;
  6.         }
  7. }
  8.  
  9. server {
  10.         listen 443;
  11.  
  12.         ssl  on;
  13.         ssl_certificate  /etc/ssl/certs/my.crt;
  14.         ssl_certificate_key  /etc/ssl/private/my.key;
  15.  
  16.         ssl_session_timeout  5m;
  17.  
  18.         ssl_protocols  SSLv3 TLSv1;
  19.         ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
  20.         ssl_prefer_server_ciphers   on;
  21.  
  22.         server_name webmail.example.com;
  23.         root   /var/www/roundcubemail-0.7/;
  24.  
  25.         location = / {
  26.                 index  index.php;
  27.         }
  28.  
  29.         location ~ .php$ {
  30.                 try_files $uri = 404;# for security reason (see Pitfall section in Nginx's wiki)
  31.                 include fastcgi_params;
  32.                 fastcgi_intercept_errors on;
  33.                 # TODO: move this to /var/run/php/
  34.                 fastcgi_pass unix:/tmp/php-cgi.socket;
  35.                 fastcgi_index  index.php;
  36.                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  37.         }
  38. }