Created
August 20, 2016 15:23
-
-
Save h0tw1r3/8fd0c48236378a88242373453ac33136 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
map $remote_user $proxy_client_domain { | |
default $remote_user; | |
} | |
upstream newsline.linearcollider.org { | |
server 127.0.1.1:80; | |
} | |
upstream linearcollider.org { | |
server 127.0.2.1:80; | |
} | |
server { | |
include listen_spdy_ssl.conf; | |
ssl_certificate /etc/letsencrypt/live/clarkmania.com-0001/fullchain.pem; | |
ssl_certificate_key /etc/letsencrypt/live/clarkmania.com-0001/privkey.pem; | |
server_name clientsites.btolab.com; | |
#auth_digest_user_file /etc/nginx/passwd.client.digest; | |
#auth_digest_shm_size 4m; | |
root /home/h0tw1r3/sites/com.btolab/default; | |
if ($not_allowed_method) { | |
return 405; | |
} | |
location / { | |
auth_basic 'Client Host'; | |
auth_basic_user_file htpasswd.clientsites; | |
subs_filter_types application/javascript application/json text/*; | |
subs_filter $proxy_client_domain clientsites.btolab.com; | |
subs_filter http:([\\\]?/[\\\]?/)clientsites.btolab.com https:$1clientsites.btolab.com ir; | |
client_max_body_size 50m; | |
proxy_http_version 1.1; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Server $http_host; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header X-HTTP-Authorization $http_authorization; | |
proxy_pass http://$proxy_client_domain; | |
proxy_set_header Host $proxy_client_domain; | |
proxy_redirect http://$proxy_client_domain/ /; | |
proxy_redirect https://$proxy_client_domain/ /; | |
proxy_redirect / /; | |
proxy_cookie_domain ~.* clientsites.btolab.com; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment