Skip to content

Instantly share code, notes, and snippets.

View searsia's full-sized avatar
🤔
migrated to https://codeberg.org/searsia

Searsia searsia

🤔
migrated to https://codeberg.org/searsia
View GitHub Profile
@searsia
searsia / yourdomain
Created January 6, 2018 09:08
Nginx example configuration (/etc/nginx/sites-available/yourdomain)
server {
listen 80;
listen [::]:80 ipv6only=on;
server_name yourdomain.top www.yourdomain.top;
location /.well-known/ {
allow all;
}
location / {
rewrite ^(.*) https://yourdomain.top$1 permanent;
}
@searsia
searsia / proxy.php
Created January 6, 2018 08:45
Simple PHP image proxy
<?php
$PROXY = 'https://yourdomain.top/proxy.php?url=';
# This script forwards the call
# Check for url parameter, and prevent file transfer
if (isset($_GET['url']) and preg_match('#^https?://#', $_GET['url']) === 1) {
$url .= $_GET['url'];
} else {