β β β ο½ππ»βΊπ«Δπ¬πβ β β β
π¦Hidden redirect, rewrite and reverse proxy server in nginx to a third-party server :
fb.com/UndercodeTestingCompany
π¦ ππΌππ πππΈβπ :
1) Redirect, rewrites the address in the browser, defines a new (rewritten)
#server {
# listen 3001;
# server_name test-on-mongo;
# return 301 $ scheme: // test-on-mongo: 5001 $ request_uri;
#}
2) Rewrite, rewrites the address in the browser, defines a new (rewritten)
#server {
# listen 3001;
# server_name test-on-mongo;
# rewrite ^ (. *) $ $ scheme: // test-on-mongo: 5001 $ 1 permanent;
# return 403;
#}
3) Rewrite, rewrites the address in the browser, defines a new (rewritten)
#server {
# listen 3001;
# server_name test-on-mongo;
# location / {
# if ($ http_host ~ "^ test-on-mongo: 3001") {
# rewrite ^ / (. *) http: // test-on-mongo: 5001 redirect;
#}
#}
#}
4) A third-party web server is running on port 3001, it was previously on port 5001
5) From the old link 5001, nginx redirects to port 80, and then to 3001
# Made to bite a port in url
server {
listen 80;
listen [::]: 80;
server_name test-on-mongo;
location / {
proxy_pass http: // test-on-mongo: 3001;
}
}
server {
listen 5001;
listen [::]: 5001;
server_name test-on-mongo;
return 301 $ scheme: // test-on-mongo $ request_uri;
}
WRITTEN BY UNDERCODE
β β β ο½ππ»βΊπ«Δπ¬πβ β β β
π¦Hidden redirect, rewrite and reverse proxy server in nginx to a third-party server :
fb.com/UndercodeTestingCompany
π¦ ππΌππ πππΈβπ :
1) Redirect, rewrites the address in the browser, defines a new (rewritten)
#server {
# listen 3001;
# server_name test-on-mongo;
# return 301 $ scheme: // test-on-mongo: 5001 $ request_uri;
#}
2) Rewrite, rewrites the address in the browser, defines a new (rewritten)
#server {
# listen 3001;
# server_name test-on-mongo;
# rewrite ^ (. *) $ $ scheme: // test-on-mongo: 5001 $ 1 permanent;
# return 403;
#}
3) Rewrite, rewrites the address in the browser, defines a new (rewritten)
#server {
# listen 3001;
# server_name test-on-mongo;
# location / {
# if ($ http_host ~ "^ test-on-mongo: 3001") {
# rewrite ^ / (. *) http: // test-on-mongo: 5001 redirect;
#}
#}
#}
4) A third-party web server is running on port 3001, it was previously on port 5001
5) From the old link 5001, nginx redirects to port 80, and then to 3001
# Made to bite a port in url
server {
listen 80;
listen [::]: 80;
server_name test-on-mongo;
location / {
proxy_pass http: // test-on-mongo: 3001;
}
}
server {
listen 5001;
listen [::]: 5001;
server_name test-on-mongo;
return 301 $ scheme: // test-on-mongo $ request_uri;
}
WRITTEN BY UNDERCODE
β β β ο½ππ»βΊπ«Δπ¬πβ β β β
Facebook
UndercOde Testing Company
UndercOde Testing Company. 94 likes Β· 6 talking about this. Local service