Had a weird case, where an Nginx is in front of an Apache web server and whenever I tried to access the website through the Nginx, the Apache's default website was shown instead of the virtual hosts website.
I had the following config in Nginx:
server {
listen 80;
server_name vhost.example.com;
location / {
include /etc/nginx/proxy.conf;
proxy_set_header Host $host;
proxy_pass http://apache:80;
}
}
The reason for this weird effect is that I already had "proxy_set_header" defined in the included config file proxy.conf. It seems that if it is defined twice, the host name gets lost and therefore Apache in the backend only serves the default server's website.
I have double-checked and verified this with these combinations:
After removing the additional "proxy_set_header" definition, the correct website for vhost.example.com was shown.
No comments yet.
AWS Android Ansible Apache Apple Atlassian BSD Backup Bash Bluecoat CMS Chef Cloud Coding Consul Containers CouchDB DB DNS Database Databases Docker ELK Elasticsearch Filebeat FreeBSD Galera Git GlusterFS Grafana Graphics HAProxy HTML Hacks Hardware Icinga Influx Internet Java KVM Kibana Kodi Kubernetes LVM LXC Linux Logstash Mac Macintosh Mail MariaDB Minio MongoDB Monitoring Multimedia MySQL NFS Nagios Network Nginx OSSEC OTRS Office PGSQL PHP Perl Personal PostgreSQL Postgres PowerDNS Proxmox Proxy Python Rancher Rant Redis Roundcube SSL Samba Seafile Security Shell SmartOS Solaris Surveillance Systemd TLS Tomcat Ubuntu Unix VMWare VMware Varnish Virtualization Windows Wireless Wordpress Wyse ZFS Zoneminder