Welcome! Log In Create A New Profile


reverse proxy multiple subdomains problems

September 03, 2018 04:07PM
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 https://my-site.com this is fine for www.my-site.com but recipes.my-site.com 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 {
server_name my-site.com www.my-site.com recipes.my-site.com;
return 301 https://$server_name$request_uri;

server {
listen ssl;

server_name my-site.com www.my-site.com recipes.my-site.com;

access_log /var/log/nginx/van-ginneken.com-access.log;
ssl_certificate /root/SYNC-certs/van-ginneken.com/fullchain.pem;
ssl_certificate_key /root/SYNC-certs/van-ginneken.com/privkey.pem;

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;
Subject Author Posted

reverse proxy multiple subdomains problems

c0mputerking September 03, 2018 04:07PM

Re: reverse proxy multiple subdomains problems

Francis Daly September 04, 2018 03:08AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 70
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready