Custom VirtualHost Hijacks domain and subdomains

virtualhosts
v7

(Christopher Suttles) #1

I have just moved from Arch Linux to NethServer. I am having a strange issue that I can’t figure out on my own reguarding a virtualhost file.

I have my blade server setup with my domain and several subdomains. Everything is working as it should. I installed Emby Media Server manually, and have been trying to get it set up on the subdomain emby.triggeredstudios.com.

When I use the same virtualhost config as I was in Arch, works, but it also breaks the Nextcloud and SOGo pages, and I can access emby even on my unused subdomains that I haven’t added to any virtualhost file yet. My desired behavior is that I only want it to be accessible via emby.triggeredstudios.com.

Here is my exact virtualhost file:

<VirtualHost *:80>
    ServerName emby.triggeredstudios.com

    RewriteEngine on
    RewriteCond %{SERVER_NAME} =emby.triggeredstudios.com
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>

<VirtualHost *:443>
    ServerName emby.triggeredstudios.com

<proxy *>
    AddDefaultCharset off
    Order Allow,Deny
    Allow from all
</proxy>

    ProxyRequests     Off
    ProxyPreserveHost On

    ProxyPass "/embywebsocket" "ws://127.0.0.1:8096/embywebsocket"
    ProxyPassReverse "/embywebsocket" "ws://127.0.0.1:8096/embywebsocket"

    ProxyPass "/" "http://127.0.0.1:8096/"
    ProxyPassReverse "/" "http://127.0.0.1:8096/"

    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/localhost.crt
    SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
</VirtualHost>

NethServer Version: 7.4.1708
Module: nethserver-httpd


(Jeroen Visser) #2

Sounds like a wildcard record in DNS, not a Vhost issue.


(Markus Neuberger) #3

Hello @Christopher_Suttles,

NethServer has its own Virtual Hosts and Reverse Proxy modules:

http://docs.nethserver.org/en/v7/virtual_hosts.html
http://docs.nethserver.org/en/v7/proxy_pass.html

I am afraid your virtualhost file in a way conflicts with already existing ones at /etc/httpd/conf.d

I don’t really know emby… What’s the advantage to other media tools? Do you know ampache or madsonic?