V
V
VA2015-11-16 12:07:39
Nginx
VA, 2015-11-16 12:07:39

How to install SSL on NGINX?

There are files from Komodo:
AddTrustExternalCARoot.crt
COMODORSAAddTrustCA.crt
COMODORSADomainValidationSecureServerCA.crt mysite.crt
They
also sent me two files:
mysite.ca-bundle
mysite.crt I
glued them in 2 ways
cat mysite.crt ComodoHigh-AssuranceSecureServerCA.crt AddTrustExternalCARoot.crt > mysite_1. crt
and
cat mysite.crt mysite.ca-bundle > mysite-bundle.crt
nginx config

user  nginx;
worker_processes  3;

error_log  /var/log/nginx/error.log crit;
pid        /var/run/nginx.pid;

worker_rlimit_nofile 200000;
events {
    worker_connections  100000;
    multi_accept on;
}


http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  /var/log/nginx/access.log  main;
     access_log off;

    keepalive_timeout  30 10;
   

    ##
    sendfile        on;
    tcp_nopush      on;
    tcp_nodelay     on;
    server_tokens   off;
    gzip            on;
    gzip_static     on;
    gzip_comp_level 9;
    gzip_min_length 1100;
    gzip_buffers    64 64k;
    gzip_vary  on;
    gzip_http_version 1.1;
    gzip_disable "MSIE [1-6]\.(?!.*SV1)";
    gzip_types  text/plain text/css image/png image/gif image/jpeg application/x-javascript text/xml application/xml application/xml+rss text/javascript application/json application/javascript text/x-js;
    reset_timedout_connection       on;     # RAS.SU adon
    lingering_time     30;
    lingering_timeout  3;
    open_file_cache          max=50000  inactive=20s;
    open_file_cache_valid    30s;
    open_file_cache_min_uses 2;
    open_file_cache_errors   on; 
    log_not_found off;
    fastcgi_buffers 512 256k;
    fastcgi_buffer_size 256k;
    # Load config files from the /etc/nginx/conf.d directory
    client_max_body_size 512M;



    #gzip  on;
    #gzip_comp_level 5;
    #gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    include /etc/nginx/conf.d/*.conf;

server {
    listen              443;
    server_name         мойсайт.ru www.мойсайт.ru;
    ssl_certificate     /etc/ssl/моцсацт-ssl-bundle.crt;
    ssl_certificate_key /etc/ssl/private.key;
    ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers         HIGH:!aNULL:!MD5;
}

}

Gives an error
nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address already in use)
What to do?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikon_NLG, 2015-11-16
@Ozymandis

Most likely apache or someone else is already listening on port 443.
sudo netstat -luntp|grep 443
will show you the pid and process name of who is occupying the port.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question