mirror of
https://github.com/samuelhbne/server-xray.git
synced 2025-12-18 21:04:38 +03:00
Proxy HOST configuration support
This commit is contained in:
2
grpc.tpl
2
grpc.tpl
@@ -5,5 +5,5 @@
|
|||||||
client_max_body_size 0;
|
client_max_body_size 0;
|
||||||
client_body_timeout 1071906480m;
|
client_body_timeout 1071906480m;
|
||||||
grpc_read_timeout 1071906480m;
|
grpc_read_timeout 1071906480m;
|
||||||
grpc_pass grpc://127.0.0.1:PORT;
|
grpc_pass grpc://HOST:PORT;
|
||||||
}
|
}
|
||||||
@@ -126,6 +126,8 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -z "${xhost}" ]; then xhost="127.0.0.1"; fi
|
||||||
|
|
||||||
# Replace the last(only) single line '}' with specific tpl file, hence insert a new section into the Nginx config file
|
# Replace the last(only) single line '}' with specific tpl file, hence insert a new section into the Nginx config file
|
||||||
case "${xnetwork}" in
|
case "${xnetwork}" in
|
||||||
ws|websocket)
|
ws|websocket)
|
||||||
@@ -138,6 +140,7 @@ do
|
|||||||
# Then add '}' to the end of the Nginx config file
|
# Then add '}' to the end of the Nginx config file
|
||||||
echo -e "\n}" >> site-xray.conf
|
echo -e "\n}" >> site-xray.conf
|
||||||
ESC_LOCATION=$(printf '%s\n' "${xlocation}" | sed -e 's/[]\/$*.^[]/\\&/g')
|
ESC_LOCATION=$(printf '%s\n' "${xlocation}" | sed -e 's/[]\/$*.^[]/\\&/g')
|
||||||
|
sed -i "s/HOST/${xhost}/g" site-xray.conf
|
||||||
sed -i "s/PORT/${xport}/g" site-xray.conf
|
sed -i "s/PORT/${xport}/g" site-xray.conf
|
||||||
sed -i "s/LOCATION/${ESC_LOCATION}/g" site-xray.conf
|
sed -i "s/LOCATION/${ESC_LOCATION}/g" site-xray.conf
|
||||||
done
|
done
|
||||||
|
|||||||
2
ws.tpl
2
ws.tpl
@@ -3,7 +3,7 @@
|
|||||||
return 404;
|
return 404;
|
||||||
}
|
}
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
proxy_pass http://127.0.0.1:PORT;
|
proxy_pass http://HOST:PORT;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
|
|||||||
Reference in New Issue
Block a user