Archive

Archive for September, 2014

OpenSSL Certificate Generation

September 24, 2014 Leave a comment

openssl req -new -newkey rsa:2048 -nodes -keyout example.key -out example.csr

Advertisements
Categories: Uncategorized

Nginx Bundle SSL Certicate Configuration

September 23, 2014 Leave a comment
cat www.example.com.crt bundle.crt > www.example.com.chained.crt

server {
       listen         80;
       server_name   www.example.com;
       rewrite        ^ https://$server_name$request_uri? permanent;
}


server {
        listen 443;
        server_name www.example.com;
        access_log /var/log/nginx/www.example.com.access.log main;
        error_log /var/log/nginx/www.example.com.error.log error;
        ssl on;
        ssl_certificate /etc/nginx/ssl/www.example.com.chained.crt;
        ssl_certificate_key /etc/nginx/ssl/www.example.com.key;

        include /etc/nginx/conf.d/includes.inc;

        location / {
                root   /var/www/html/www.example.com;
                index index.php;
        }

        location /phpmyadmin {
                alias /usr/share/phpMyAdmin;
                index index.php;
                allow  x.x.x.x;
                deny all;
        }

        location ~ /phpmyadmin/.*\.php$ {
                if ($fastcgi_script_name ~ /phpmyadmin(/.*\.php)$) {
                        set $valid_fastcgi_script_name $1;
                }
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME /usr/share/phpMyAdmin$valid_fastcgi_script_name;
                include /etc/nginx/fastcgi_params;
        }

        location ~ \.php$ {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME /var/www/html/www.example.com$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_script_name;
                include /etc/nginx/fastcgi_params;
        }
}



Categories: Uncategorized