2024-06-03 07:25:11 -07:00

3.1 KiB

status, type, created, updated
status type created updated
4-Done kanbn 2024-01-06T01:22:07.445Z 2024-01-06T01:22:07.445Z

setup-nginx

echo >/etc/nginx/sites-available/default && nano /etc/nginx/sites-available/default
server {
    listen 80 default_server;
    listen [::]:80 default_server;
    root /var/www/html;
    index index.html index.htm index.nginx-debian.html;
    server_name _;
    location / {
        try_files $uri $uri/ =404;
    }
}
systemctl restart nginx
lsof -i -P -n | grep LISTEN
links http://192.168.0.204/
nginx -t
nginx -s reload
echo >/etc/nginx/sites-available/Barcode-Host-Server && nano /etc/nginx/sites-available/Barcode-Host-Server
server {
    listen 80 default_server;
    listen [::]:80 default_server;
    root /var/www/html;
    index index.html index.htm index.nginx-debian.html;
    server_name _;
    location / {
        try_files $uri $uri/ =404;
    }
}
echo >/home/unity4/localhost.conf && nano /home/unity4/localhost.conf
[req]
default_bits       = 2048
default_keyfile    = localhost.key
distinguished_name = req_distinguished_name
req_extensions     = req_ext
x509_extensions    = v3_ca

[req_distinguished_name]
countryName                 = Country Name (2 letter code)
countryName_default         = US
stateOrProvinceName         = State or Province Name (full name)
stateOrProvinceName_default = Arizona
localityName                = Locality Name (eg, city)
localityName_default        = Mesa
organizationName            = Organization Name (eg, company)
organizationName_default    = Infineon Technologies Americas Corp.
organizationalUnitName      = organizationalunit
organizationalUnitName_default = Development
commonName                  = Common Name (e.g. server FQDN or YOUR name)
commonName_default          = unity4
commonName_max              = 64

[req_ext]
subjectAltName = @alt_names

[v3_ca]
subjectAltName = @alt_names

[alt_names]
DNS.1   = unity4
DNS.2   = localhost
DNS.3   = 127.0.0.1
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/localhost.key -out /etc/nginx/localhost.crt -config /home/unity4/localhost.conf
ls /etc/nginx
echo >/etc/nginx/sites-available/Barcode-Host-Server && nano /etc/nginx/sites-available/Barcode-Host-Server
server {
    server_name _;
    ssl_certificate 'localhost.crt';
    listen 443 default_server ssl http2;
    ssl_certificate_key 'localhost.key';
    ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
    error_page 500 502 503 504 /50x.html;
    listen [::]:443 default_server ssl http2;
    location / {
        proxy_pass http://localhost:5003;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $http_connection;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}
ln -s /etc/nginx/sites-available/Barcode-Host-Server /etc/nginx/sites-enabled/Barcode-Host-Server
nginx -t
nginx -s reload
links https://localhost/api/lastscan
links https://unity4/api/lastscan
# C:\Windows\System32\drivers\etc\hosts
192.168.0.204 unity4

Sub-tasks

  • phares3757
  • unity4
  • unity5