http {
...
upstream apache {
server 127.0.0.1:8080;
}
server {
listen 80 default_server;
server_name 123.456.789.012;
location / {
proxy_pass http://apache;
}
}
server {
listen 80;
server_name site1.ru;
...
location / {
proxy_pass http://apache;
}
}
server {
listen 80;
server_name site2.ru;
...
location / {
proxy_pass http://apache;
}
}
}
server {
listen 443 default;
server_name example.com;
ssl on;
ssl_certificate /etc/nginx/ssl/example.com/server.crt;
ssl_certificate_key /etc/nginx/ssl/example.com/server.key;
location / {
proxy_pass http://apache;
}
}
server {
listen 443;
server_name vk.com;
ssl on;
ssl_certificate /etc/nginx/ssl/vk.com/server.crt;
ssl_certificate_key /etc/nginx/ssl/vk.com/server.key;
location / {
proxy_pass http://apache_vk;
}
}