Ready to test in Fab
This commit is contained in:
113
.kanbn/tasks/setup-nginx.md
Normal file
113
.kanbn/tasks/setup-nginx.md
Normal file
@ -0,0 +1,113 @@
|
||||
---
|
||||
---
|
||||
|
||||
# setup-nginx
|
||||
|
||||
```bash
|
||||
echo >/etc/nginx/sites-available/default && nano /etc/nginx/sites-available/default
|
||||
```
|
||||
```conf
|
||||
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;
|
||||
}
|
||||
}
|
||||
```
|
||||
```bash
|
||||
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
|
||||
```
|
||||
```conf
|
||||
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;
|
||||
}
|
||||
}
|
||||
```
|
||||
```bash
|
||||
echo >/home/unity4/localhost.conf && nano /home/unity4/localhost.conf
|
||||
```
|
||||
```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
|
||||
```
|
||||
```bash
|
||||
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
|
||||
```
|
||||
```conf
|
||||
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;
|
||||
}
|
||||
}
|
||||
```
|
||||
```bash
|
||||
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
|
||||
```
|
||||
```conf
|
||||
# C:\Windows\System32\drivers\etc\hosts
|
||||
192.168.0.204 unity4
|
||||
```
|
||||
|
||||
## Sub-tasks
|
||||
|
||||
- [x] phares3757
|
||||
- [x] unity4
|
||||
- [x] unity5
|
Reference in New Issue
Block a user