Skip to content

Instantly share code, notes, and snippets.

@laozhu
Created September 28, 2012 10:13
Show Gist options
  • Save laozhu/3799003 to your computer and use it in GitHub Desktop.
Save laozhu/3799003 to your computer and use it in GitHub Desktop.
42qu Reverse Proxy
server {
listen 80;
server_name supyer.com.42qu.com *.supyer.com.42qu.com;
client_max_body_size 512M;
location / {
expires -1;
set $realhost supyer.com;
if ($host ~ "(.*.supyer.com).42qu.com") {
set $realhost $1;
}
proxy_set_header Host $realhost;
proxy_pass http://supyer.com.42qu.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log /var/log/nginx/main.access_log info;
error_log /var/log/nginx/main.error_log info;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment