Skip to content

Instantly share code, notes, and snippets.

Source: https://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html
This page collects hints how to improve the security of nginx web servers running on Linux or UNIX-like operating systems.
Default Config Files and Nginx Port
/usr/local/nginx/conf/ or /etc/nginx/– The nginx server configuration directory and /usr/local/nginx/conf/nginx.conf is main configuration file.
/usr/local/nginx/html/ or /var/www/html– The default document location.
/usr/local/nginx/logs/ or /var/log/nginx – The default log file location.
Nginx HTTP default port : TCP 80
@publicarray
publicarray / Nginx.md
Last active September 29, 2020 21:12
Nginx with modules and latest OpenSSL [CentOS]

Nginx/OpenSSL on CentOS

@hongshunyang
hongshunyang / github-to-bitbucket
Last active March 13, 2018 14:35 — forked from sangeeths/github-to-bitbucket
Forking a Github repo to Bitbucket
Go to Bitbucket and create a new repository (its better to have an empty repo)
git clone git@bitbucket.org:abc/myforkedrepo.git
cd myforkedrepo
Now add Github repo as a new remote in Bitbucket called "sync"
git remote add sync git@github.com:def/originalrepo.git
Verify what are the remotes currently being setup for "myforkedrepo". This following command should show "fetch" and "push" for two remotes i.e. "origin" and "sync"
git remote -v
@gtgt
gtgt / build-php-static.sh
Last active March 6, 2024 04:51
Script to build static php
#!/bin/bash
U=${SUDO_USER:=${USER}}
if [[ -x `which realpath` ]]; then
T=$(realpath ${BASH_SOURCE[0]:=${0}})
else
T=${BASH_SOURCE[0]:=${0}}
fi
D=$(dirname ${T})
#apt-get install libfcgi-dev libfcgi0ldbl libjpeg62-turbo-dbg libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev libxml2-dev libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev libfreetype6-dev libkrb5-dev libpq-dev libxml2-dev libtidy-dev libmemcached-dev imagemagick-dev msgpack-dev
@odan
odan / rest_quick_reference.md
Last active September 1, 2021 20:06
REST, RESTful API Quick Reference
@AliFlux
AliFlux / ExiftoolProcess.cs
Last active January 27, 2024 08:56
Process exiftool tags using C#
public static Dictionary<string, string> getExifDataViaTool(string sourceFile, string parameters = "-a")
{
var result = new Dictionary<string, string>();
// escaping path command line
sourceFile = Regex.Replace(sourceFile, @"(\\*)" + "\"", @"$1\$0");
sourceFile = Regex.Replace(sourceFile, @"^(.*\s.*?)(\\*)$", "\"$1$2$2\"");
var argumentsString = parameters + " " + sourceFile;
## Useful Commands
Get kubectl version
kubectl version
Get cluster info:
@cokebar
cokebar / install_nginx_with_libressl.sh
Last active January 29, 2020 06:07
A example script to build and install nginx with libressl instead of openssl
#!/bin/bash
set -e -o pipefail
latest_nginx=$(curl -L http://nginx.org/en/download.html | egrep -o "nginx\-[0-9.]+\.tar[.a-z]*" | head -n 1)
latest_libressl=$(curl -L http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ | egrep -o "libressl\-[0-9.]+\.tar\.gz" | tail -n 1)
(curl -fLRO "http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${latest_libressl}" && tar -xaf "${latest_libressl}") &
(curl -fLRO "http://nginx.org/download/${latest_nginx}" && tar -xaf "${latest_nginx}") &
wait
@abhi9bakshi
abhi9bakshi / tincan_moodle_learninglocker_setup.md
Last active June 1, 2022 08:15
Setting Up TinCan API with Moodle LMS and Learning Locker LRS in Ubuntu 16.04

#Setting Up TinCan API with Moodle LMS and Learning Locker LRS

#Part 1: Virtual Container

Before we get our hands dirty with the entire setup, it is necessary to ensure we do not mess with the existing installation. Setting up and configuring a local server is tricky and may sometimes break your existing configuration rendering other programs which rely on it useless. So we will use LXC to create a virtual container, where we will do all good stuff. You can read the official LXC documentation here or a brief introduction about LXC here or get started right away with the commands below.

sudo apt-get install lxc lxd-client
sudo lxc-create -t download -n LMSprototype
@rahilwazir
rahilwazir / vmdk_vhdx.md
Last active March 3, 2024 22:01
Convert VMWare to Hyper-V (vmdk to vhdx)