Nginx for multiple sub-domain?

Hello,
I have a web site, e.g., www.example.com
under it, i have several sub-domains, e.g., /register, /query, /report.

I have a requirement that,
/query is for port 80
/register is for port 443, but with server side SSL certificate
verification.
/report is for port 443 , with both server and client side SSL
certificate verification.

I want to know whether NGX config can do this ?

I have the problem to config /register and /report under port 443.

Thanks,
Yanxin

On Fri, May 20, 2011 at 07:14:44PM +0200, Yanxin Z. wrote:

I want to know whether NGX config can do this ?

I have the problem to config /register and /report under port 443.

server {
listen 80;
server_name www.example.com;
location /query {

}
}

server {
listen 443;
server_name www.example.com;

ssl                  on;
ssl_certificate      www.nginx.com.crt;
ssl_certificate_key  www.nginx.com.key;

ssl_verify_client       optional;
ssl_client_certificate  CA.crt;

location /register {
     ...
}

location /report {
     if ($ssl_client_verify != SUCCESS) {
         return 403;
     }
     ...
}

}

http://nginx.org/en/docs/http/configuring_https_servers.html


Igor S.

Thank you Igor!!
NGX is so powerful. It’s working for me.

Another question, for CA cert, I also need to verify PEM pass phase.
Can I do it in NGX config?

Thanks,
Yanxin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs