From 63276d53aac4857e35c7a819976a6a0716bef63a Mon Sep 17 00:00:00 2001 From: Mike Phares Date: Fri, 23 Dec 2022 11:54:54 -0700 Subject: [PATCH] flop dex --- conf/includes/dex.conf | 29 +++++++++++++++++++++++++++++ conf/includes/json.conf | 12 ++++++------ conf/includes/localhost.conf | 9 +++++---- conf/includes/wwwroot.conf | 4 ++++ conf/nginx.conf | 12 +++++++++++- 5 files changed, 55 insertions(+), 11 deletions(-) create mode 100644 conf/includes/dex.conf create mode 100644 conf/includes/wwwroot.conf diff --git a/conf/includes/dex.conf b/conf/includes/dex.conf new file mode 100644 index 0000000..6eca895 --- /dev/null +++ b/conf/includes/dex.conf @@ -0,0 +1,29 @@ +location ~* .(3gp|apng|avi|avif|bmp|css|cur|flv|gif|htm|html|ico|jfif|jpeg|jpg|js|mid|mov|mp3|mp4|mpeg|mpg|ogg|pdf|php|pjp|pjpeg|png|svg|tif|tiff|txt|wav|webp|wmf|wml|wmv|xml|xml)$ { + expires 1d; + index index.html index.htm; + # ln -s /etc/nginx/sites-available/json /etc/nginx/sites-enabled/ + # ln -s /srv/samba/share/637998119172547651 /var/www/html/637998119172547651 + # ln -s /var/www/html/NGINdeX.io /var/www/html/637998119172547651/NGINdeX.io + # ln -s /srv/git /var/www/html/637998119172547651/git + # root /var/www/html/637998119172547651; + # mklink /J "D:\Tmp\Phares\www\pictures" "D:\Documents\Pictures" + # mklink /J "D:\Tmp\Phares\www\NGINdeX.io" "L:\Git\NGINdeX.io" + root "D://Tmp//phares//www"; +} +location / { + index index.html index.htm; + # root /var/www/html/637998119172547651; + # mklink /J "D:\Tmp\Phares\www\pictures" "D:\Documents\Pictures" + # mklink /J "D:\Tmp\Phares\www\NGINdeX.io" "L:\Git\NGINdeX.io" + root "D://Tmp//phares//www"; + # First attempt to serve request as file, then + autoindex on; + # Send the data in JSON + autoindex_format json; + addition_types application/json; + # Calling from SERVERNAME/autoindex/* + add_before_body /NGINdeX.io/header.html; + add_after_body /NGINdeX.io/footer.html; + # Need to tell that we are sending HTML + add_header Content-Type text/html; +} \ No newline at end of file diff --git a/conf/includes/json.conf b/conf/includes/json.conf index 8dc037f..a2584e2 100644 --- a/conf/includes/json.conf +++ b/conf/includes/json.conf @@ -7,23 +7,23 @@ location ~* .(3gp|apng|avi|avif|bmp|css|cur|flv|gif|htm|html|ico|jfif|jpeg|jpg|j # ln -s /srv/git /var/www/html/637998119172547651/git # root /var/www/html/637998119172547651; # mklink /J "D:\Tmp\Phares\www\pictures" "D:\Documents\Pictures" - # mklink /J "D:\Tmp\Phares\www\NGINdeX.io" "L:\GitHub\NGINdeX.io" + # mklink /J "D:\Tmp\Phares\www\NGINdeX.io" "L:\Git\NGINdeX.io" root "D://Tmp//phares//www"; } location / { index index.html index.htm; # root /var/www/html/637998119172547651; # mklink /J "D:\Tmp\Phares\www\pictures" "D:\Documents\Pictures" - # mklink /J "D:\Tmp\Phares\www\NGINdeX.io" "L:\GitHub\NGINdeX.io" + # mklink /J "D:\Tmp\Phares\www\NGINdeX.io" "L:\Git\NGINdeX.io" root "D://Tmp//phares//www"; # First attempt to serve request as file, then autoindex on; # Send the data in JSON autoindex_format json; - addition_types application/json; + # addition_types application/json; # Calling from SERVERNAME/autoindex/* - add_before_body /NGINdeX.io/header.html; - add_after_body /NGINdeX.io/footer.html; + # add_before_body /NGINdeX.io/header.html; + # add_after_body /NGINdeX.io/footer.html; # Need to tell that we are sending HTML - add_header Content-Type text/html; + # add_header Content-Type text/html; } \ No newline at end of file diff --git a/conf/includes/localhost.conf b/conf/includes/localhost.conf index b733e71..de14e84 100644 --- a/conf/includes/localhost.conf +++ b/conf/includes/localhost.conf @@ -13,11 +13,11 @@ stateOrProvinceName_default = Arizona localityName = Locality Name (eg, city) localityName_default = Mesa organizationName = Organization Name (eg, company) -organizationName_default = localhost +organizationName_default = Infineon Technologies Americas Corp. organizationalUnitName = organizationalunit organizationalUnitName_default = Development commonName = Common Name (e.g. server FQDN or YOUR name) -commonName_default = localhost +commonName_default = example.com commonName_max = 64 [req_ext] @@ -27,8 +27,9 @@ subjectAltName = @alt_names subjectAltName = @alt_names [alt_names] -DNS.1 = localhost -DNS.2 = 127.0.0.1 +DNS.1 = example.com +DNS.2 = localhost +DNS.3 = 127.0.0.1 # https://webscoot.io/blog/create-self-signed-certificate-ubuntu-windows-nginx/ # cd "C:\Program Files\Git\usr\bin" diff --git a/conf/includes/wwwroot.conf b/conf/includes/wwwroot.conf new file mode 100644 index 0000000..159b1f3 --- /dev/null +++ b/conf/includes/wwwroot.conf @@ -0,0 +1,4 @@ +location / { + root "D://wwwroot"; + try_files $uri $uri/ /index.html =404; +} \ No newline at end of file diff --git a/conf/nginx.conf b/conf/nginx.conf index c2f1fff..dd602b1 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -33,13 +33,23 @@ http { server { listen 5052; server_name localhost; - include "includes/json.conf"; + include "includes/dex.conf"; } server { listen 5053; server_name localhost; include "includes/ProgramData.conf"; } + server { + listen 5054; + server_name localhost; + include "includes/json.conf"; + } + server { + listen 5055; + server_name localhost; + include "includes/wwwroot.conf"; + } server { listen 8011; server_name localhost;