Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: reverse proxy with ssl redirecting to wrong server

$
0
0
Here's a simplified config file:

server {
listen 9999;
listen 444 ssl;
server_name www.site3.com;

ssl_certificate /etc/nginx/ssl/site3.com/server-nginx.crt;
ssl_certificate_key /etc/nginx/ssl/site3.com/nophrase.key;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_pass http://10.0.0.98:80;
}
}
server {
listen 9999;
server_name www.site2.com;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_pass http://10.0.0.99:80;
}
}
server {
listen 9999;
server_name site4.com;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_pass http://10.0.0.99:80;
}
}
server {
listen 9999;
server_name blog.site4.com;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_pass http://10.0.0.99:80;
}
}
server {
listen 444 ssl;
listen 9999;
server_name www.ultrasoundoftheweek.com;

ssl_certificate /etc/nginx/ssl/ultrasoundoftheweek.com/server-nginx.crt;
ssl_certificate_key /etc/nginx/ssl/ultrasoundoftheweek.com/nophrase.key;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_pass http://10.0.0.99:80;
}
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>