server { listen 172.31.18.221:80; server_name www.example.info example.info; charset utf-8; rewrite ^ https://www.example.info$request_uri? permanent; } server { listen 172.31.18.221:443 ssl; server_name www.example.info example.info; charset utf-8; add_header Strict-Transport-Security max-age=15768000; root /var/www/example/w; index index.html index.htm; error_log /var/log/nginx/example_error.log error; access_log /var/log/nginx/example_access.log combined; if ($host = 'example.info') { rewrite ^/(.*)$ https://www.example.info/$1 permanent; } ssl on; ssl_certificate example2.pem; ssl_certificate_key example2.key; ssl_session_cache shared:SSL:50m; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers "ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4"; # Disable weak ciphers ssl_prefer_server_ciphers on; location / { index index.php; error_page 404 = @mediawiki; } location @mediawiki { rewrite ^/wiki([^?]*)(?:\?(.*))? /index.php?title=$1&$2 last; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } location ~ /\.ht { deny all; } }