nginx as a forward proxy (kind of)

Sam J. lists at
Sat Sep 13 22:28:30 UTC 2014


I am very new to nginx and have a quick question.
I am using nginx to basically redirect certain websites through another
proxy. I am using DNS to resolve * to the  IP address of
nginx server.
I am able to get it to work with (see sample config
below) but would like it to redirect any subdomain (wildcard) to
corresponding subdomain. Any way to do this without having a similar
config for each subdomain?

server {
server_name  *;
ssl    on;
ssl_certificate    /tmp/test_cert.crt;
ssl_certificate_key    /tmp/test_cert.key;
access_log  /var/log/nginx/log/www.example.access.log  main;
error_log  /var/log/nginx/log/www.example.error.log;
location / {

Posted via

More information about the nginx mailing list