Inicio Linux & Systems Networks & Infrastructure Cybersecurity Cloud & DevOps SIEM & Monitoring DFIR & Threat Intel Development & Other Todas las categorias Herramientas

Configurar multiples certificados SSL en una misma ip con Nginx

Configurar multiples certificados SSL en una misma ip con Nginx

Tabla de contenidos

En la anterior entrada vimos como configurar tanto en nginx como en apache un certificado, esta vez vamos a configurar dos vhost con el mismo certificado y dirección IP.

Para realizar esto variaremos los puerto por el cual da servicio

nginx
server {
listen 80;
listen   443 ssl;
server_name  pre-red-orbita.com;
access_log logs/redorbita-access.log combined;
ssl on;
ssl_certificate /etc/nginx/certs/redorbita.crt;
ssl_certificate_key /etc/nginx/certs/redorbita.key;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;        error_log logs/bbvaopen4u-error.log;
root /var/www/;
index index.php index.html index.htm;
location / {
root /var/www/preredorbita;
index index.php index.html index.htm;
if (-f $request_filename) {
expires 30d;
break;
}
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
}
location ~ \.php$ {
proxy_set_header X-Real-IP  $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
# redirect server error pages to the static page /40x.html
#
error_page  404              /404.html;
location = /40x.html {
}
# redirect server error pages to the static page /50x.html
#
error_page   500 502 503 504  /50x.html;
location = /51x.html {
}
}
server {
listen 81;
listen   444 ssl;
server_name  pre2-red-orbita.com;
access_log logs/redorbita2-access.log combined;
ssl_certificate /etc/nginx/certs/redorbita.crt;
ssl_certificate_key /etc/nginx/certs/redorbita.key;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;        error_log logs/bbvaopen4u-error.log;
root /var/www/;
index index.php index.html index.htm;
location / {
root /var/www/pre2redorbita;
index index.php index.html index.htm;
if (-f $request_filename) {
expires 30d;
break;
}
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
}
}
location ~ \.php$ {
proxy_set_header X-Real-IP  $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
# redirect server error pages to the static page /40x.html
#
error_page  404              /404.html;
location = /40x.html {
}
# redirect server error pages to the static page /50x.html
#
error_page   500 502 503 504  /50x.html;
location = /51x.html {
}
}

Un saludo.

:wq!

Comentarios