This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen *:443 ssl; | |
server_name DOMAINNAME www.DOMAINNAME ; | |
root /var/www/verifier/; | |
index index.php index.html index.htm; | |
access_log /var/log/nginx/DOMAINNAME.log; | |
error_log /var/log/nginx/DOMAINNAME.error.log; | |
ssl_certificate /etc/letsencrypt/live/DOMAINNAME/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/DOMAINNAME/privkey.pem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Implement TLS 1.3 0-RTT anti-replay for NGINX | |
# Requires: NGINX directive "ssl_early_data" on | |
# Usage: | |
# Make sure these "map" blocks are included in "http" block | |
# Put the following two lines in SSL "server" block, before any "location" blocks | |
# if ($anti_replay = 307) { return 307 https://$host$request_uri; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-----BEGIN DH PARAMETERS----- | |
MIICCAKCAgEA7N3ZOcXgACR0Rat9G/7h8krD7ysVvmEmvAdg8o5l7eKVdtp/QSNK | |
anF0JyInJMBEgq05GY7YwvFovglJL73T/eEjTK3qPU6eHzxNGKfR0pM6rnAb+EXL | |
dSNJm3Xz9wH4IKn6OJ3nD9aLmBVI5FlIMV1R4QKX3sIWUxRqRSQIzjNQTnY1e/Pk | |
BT/ZrUUF7fPPVbg0nPD8Y48ISr7pB6M14Kr66cggGIqUVdBdkPYyt4RpFWR1n3Tv | |
rz1j0U+UoVnan2FgGsSiSFT9I/CiIxgC/SrdwxZLUgbAiKsnw9H7nGW92C4cRqY0 | |
2eKMVNEBk32GSPQXaA+Q5TILyzxuwDbXMxHMxnUVKQGFEcXjWXXyiv7tLAeu68Do | |
j5iNFOHbDp17SftnxYHi2vTsYk+9K6Pzc+NmUgibM52Rs92PPYd++HcgMeGrYcqi | |
temHP2jPtAymixch0wdqBMgeGTb29w51LR0BAU6D6BeR25pkZvPUag3bb6SU1Oli | |
E15DDWh3UnmfTw2M9W1uxlzQAlXOLL6/ZWuvwyqhCY6X7tIONtSgdYGjtiTFaPJp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cloudflare IP Ranges | |
# IPv4 | |
set_real_ip_from 103.21.244.0/22; | |
set_real_ip_from 103.22.200.0/22; | |
set_real_ip_from 103.31.4.0/22; | |
set_real_ip_from 104.16.0.0/13; | |
set_real_ip_from 104.24.0.0/14; | |
set_real_ip_from 108.162.192.0/18; | |
set_real_ip_from 131.0.72.0/22; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Server globals | |
user www-data; | |
worker_processes auto; | |
worker_rlimit_nofile 65535; | |
error_log /var/log/nginx/error.log; | |
pid /run/nginx.pid; | |
include /etc/nginx/conf.d/main/*.conf; | |
include /etc/nginx/modules-enabled/*.conf; | |
# Worker config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before | |
root@ns5028044:~# cat /etc/netplan/50-cloud-init.yaml | |
network: | |
version: 2 | |
ethernets: | |
eno1np0: | |
match: | |
macaddress: "9c:6b:00:3f:4f:f9" | |
addresses: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is_mobile() | |
{ | |
if (empty($_SERVER["HTTP_USER_AGENT"])) { | |
return false; | |
} | |
return @preg_match("/(android|webos|avantgo|iphone|ipad|ipod|blackberry|iemobile|bolt|boost|cricket|docomo|fone|hiptop|mini|opera mini|kitkat|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", ''.$_SERVER["HTTP_USER_AGENT"]); | |
} | |
function is_iphone() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function find_user_ip() | |
{ | |
foreach (array('HTTP_CF_CONNECTING_IP', 'HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) { | |
if (array_key_exists($key, $_SERVER) && !empty($_SERVER[$key])) { | |
foreach (@explode(',', ''.$_SERVER[$key]) as $ip) { | |
$ip = trim($ip); | |
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) !== false) { | |
return $ip; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Author: ServerOK | |
# Web: https://serverok.in/server-to-server-file-transfer-with-php-script | |
# URL of the file to be downloaded | |
$source_url = 'https://example.com/backup.zip'; | |
$filename = basename(parse_url($source_url, PHP_URL_PATH)); | |
$destination_path = __DIR__ . '/' . $filename; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reaplce YOUR-DOMAIN.EXT with you actual domain or subdomain. Point domain to server IP by editing DNS. | |
To create a new wordpress site, create a dirctory | |
/var/www/YOUR-DOMAIN.EXT/public_html | |
Upload wordpress files inside. | |
Create nginx config |
NewerOlder