Proxying *.example.com in *.localTLD?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
12 views
You need to proxy http requests to *.example.com in *.localTLD, though if somedomain.localTLD not resolved should be thrown into the default page (I think, it through the error page for 502 Bad gateway can you do).


As for nginx, lighttpd, apache to do a tricky proxy not to certain domains?
by | 12 views

2 Answers

0 like 0 dislike
Then you can register
\r
server_name default; if ($host ~* (.*).example.com) { set $host_prefix $1; rewrite ^.*$ http://$host_prefix.localTLD/ permanent; } 
by
0 like 0 dislike
For Nginx approximately
\r
server { listen 0.0.0.0:80; server_name www.example.com; location / { # Proximum proxy_pass http://somedomain.localTLD; # Errors are intercepted for processing before delivery to the client proxy_intercept_errors on; # additional parameters if needed # for example, if proximate on the IP you usually need to specify host # proxy_set_header Host 'somedomain.localTLD'; # Or # proxy_read_timeout 60; } location /pages/ { root /var/www/; } # Further processing of the error error_page 502 503 504 /50x.html; # Or if you want to answer 200 and give a different page then # error_page 502 503 504 =200 /pages/page.html; } 

For proxying
\rwiki.nginx.org/HttpProxyModule
Errors
\rwiki.nginx.org/HttpCoreModule#error_page
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
asked Mar 24, 2019 by Igozzzz
0 like 0 dislike
3 answers
asked Apr 5, 2019 by Runcorn
0 like 0 dislike
3 answers
asked Apr 1, 2019 by Runcorn
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
27,905 users