Posted on Leave a comment

Nginx on custom ports

NGINX on Custop Ports

This configuration is actual one on server/machine, hop, on my network. And it is live.

How to use custom ports on NGINX?

Add all IPs:

server { 
....
listen 5085 default_server http2;
listen [::]:5086 default_server http2 ssl;
listen 192.*:5086 http2 ssl;
listen [2600:1700:a*:8*:2*:b*:f*:f*]:5086 http2 ssl;
server_name hop.a1z.us www.hop.a1z.us;
....
}

server {
....
server_name nginx.hop.a1z.us www.nginx.hop.a1z.us;
listen 5087;
listen 192.*:5087;
listen [*]:5087;
....
listen 192.*:5088 ssl http2;
listen [*]:5088 ssl http2;
listen [::]:5088 http2 ssl;
....
}

Did not work until I added all the IPs including local and ip6!

Posted on Leave a comment

how to check fingerprint of a certificate

how to check fingerprint of a certificate?

Needed tools:

Access to a server, desktop, or a docker container via SSH.

Create a file named fingerprint.sh in Linux and add the following lines to the file.

#!/bin/bash
file="ssl.cert" || $1; 
echo "sha256"; 
openssl x509 -noout -fingerprint -sha256 -inform pem -in $file; 
echo "sha1"; 
openssl x509 -noout -fingerprint -sha1 -inform pem -in $file;
echo "md5"; 
openssl x509 -noout -fingerprint -md5 -inform pem -in $file;

Make the file executable

chmod +x fingerprint.sh

Run the program/script:

./fingerprint.sh

You will see a result similar to the following.

-sh-4.2$ ./ssl/fingerprint.sh path/to/certificate.crt

sha256

SHA256 Fingerprint=FB:3F:9D:7B:EA:56:84:BE:3D:AB:94:09:BA:85:4C:8A:BA:3A:84:10:A3:50:A2:CF:A7:B5:2F:C2:D4:56:3D:10

sha1

SHA1 Fingerprint=23:3B:66:BA:E0:00:7C:2C:91:84:87:37:FB:E6:A3:64:DC:84:81:66

md5

MD5 Fingerprint=A8:17:88:63:39:D0:40:7A:44:B4:87:EA:E8:86:1A:04

That’s it.