4/28/2020

DSC Azure automation Linux

Have a problem in your DSC configuration.


"Failed to apply the configuration. These resources produced errors: [nxFile]MyFolder. Detailed error information can be found in the log file.\"}"]




4/09/2020

Nginx solution for check http_stub_status_module



Nginx add internal configuration to use http_stub_status_module


4/07/2020

Nginx Reverse configuration

Simple Nginx proxy reverse configuration


add the file proxy.conf in /etc/nginx/conf.d/


proxy_http_version 1.1;

proxy_set_header Host               $http_host;
proxy_set_header X-Real-IP          $remote_addr;
proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto  $scheme;
proxy_set_header Upgrade            $http_upgrade;
proxy_set_header Connection         "Upgrade"; 



Configuration for the domain simple

server {
  listen 80;
  listen [::]:80;

  server_name example.com;

  location / { 
 include    conf.d/proxy.conf;
 proxy_pass http://192.168.123.321:3000/;
  }
}







4/01/2020

How to pass value of a variable in ssh command

How make a script using a local or remote variable in other script


 Sample SCRIPT


 #!/bin/bash
## find the last or new backup file in the folder and create a variable name
DBFILE DBFILE=`ssh -t serverB@192.0.0.1 "sudo find /temp/backup.sql -type f -mtime -1 -name "*.sql""`

 ###( just show the name file)
echo $DBFILE  
###  send the variable local to remote server
echo here is DBFILE $DBFILE
#ssh -t serverB@192.0.0.1 "sudo cp $DBFILE /home/user/"
## Script execute remote with the variable 
#/usr/bin/scp serverB@192.0.0.1:/home/user/$DBFILE  /opt/temp