Home > Uncategorized > Nginx Bundle SSL Certicate Configuration

Nginx Bundle SSL Certicate Configuration

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;
        }
}



Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: