reverse proxy multiple subdomains problems

c0mputerking nginx-forum at
Mon Sep 3 20:07:49 UTC 2018

I am trying to do a redirect from http and a reverse proxy to my apache web
server. I would like to include several subdomains, they all have dns
records and apache virtual hosts setup on the other end.  However no matter
which of the 3 subdomains i try i always end up at this
is fine for but is a supposed to be a
different website all together.

I am new with nginx and have a hunch that it may have something to do with
$server_name$request_uri not being the right option in my case but i'm not
sure see config below 

server {
        return 301 https://$server_name$request_uri;

server {
listen ssl;
access_log /var/log/nginx/;
ssl_certificate /root/SYNC-certs/;
ssl_certificate_key /root/SYNC-certs/;
set $upstream;
location / {
proxy_pass_header Authorization;
proxy_pass https://$upstream;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_buffering off;
client_max_body_size 0;
proxy_read_timeout 36000s;
proxy_redirect off;
proxy_ssl_session_reuse off;

Posted at Nginx Forum:,281086,281086#msg-281086

More information about the nginx mailing list