Jump to content

[Solved] Emby apach vhost


Okeur75
Go to solution Solved by Okeur75,

Recommended Posts

Okeur75

Hello guys,

 

Yes another apache reverse proxy tuto but I'm a bit stuck !

 

I found a vhost config that works in my case :

<VirtualHost *:80>
    ServerName       my.website
    Redirect         permanent /emby https://my.website/emby
</VirtualHost>

<VirtualHost *:443>
	ServerName my.website

	ErrorLog ${APACHE_LOG_DIR}/emby-error_log
	LogFormat "%t \"%r\" %>s" common
	CustomLog ${APACHE_LOG_DIR}/emby-access_log common

	RewriteEngine on
	RewriteRule ^/emby$ /emby/ [R]

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

	ProxyRequests     Off
	ProxyPreserveHost On

	<Location /emby>
			ProxyPass        http://localhost:8096
			ProxyPassReverse http://localhost:8096
	</Location>

	<Location /emby/emby>
			ProxyPass        ws://localhost:8096/emby
			ProxyPassReverse ws://localhost:8096/emby
	</Location>
</VirtualHost>

If I only enable this vhost it's working.

 

But ! I also have transmission running with the following configuration:

<VirtualHost *:443>
        ServerName my.website
        ServerAlias www.my.website
        Redirect permanent /transmission https://my.website/transmission

        RewriteEngine on
        RewriteRule /transmission[/]?$ /transmission/web/ [R=permanent]

        ProxyRequests On
        ProxyPreserveHost Off
        <Proxy *>
        Order allow,deny
        Allow from all
        </Proxy>

        ProxyPass /transmission http://127.0.0.1:9091/transmission
        ProxyPassReverse /transmission http://127.0.0.1:9091/transmission
</Virtualhost>

<VirtualHost *:80>
        ServerName my.website
        ServerAlias www.my.website
        Redirect permanent /transmission https://my.website/transmission
</Virtualhost>

If I enable emby first (by renaming the file 01-emby and 03-transmission) : emby is working but transmission is not.

If I enable transmission first (01-transmission and 03-emby) : transmission is working and emby is not with the following error message : You don't have permission to access /emby on this server.

So I guess there is some issue with the rewrite rule.

 

In emby dashboard I selected the "Secure connection mode" parameter to "Handled by reverse proxy".

 

For info https://my.website:8920/emby is working.

 

I'm not really familiar with Apache so I may have missed something obvious.

 

Thanks for your help guys !

Edited by Okeur75
Link to comment
Share on other sites

pir8radio

@@pir8radio are you familiar with transmission?

 

 

Yea, but I think his issue is config related..   I assume when you say you use transmission you mean the web interface to the torrent client?   

 

Post your whole apache config with both transmission and emby sections in that you want...  and lets take a look at it. 

 

switch to nginx and we can get you up in no time!  :-)

Edited by pir8radio
Link to comment
Share on other sites

Okeur75

Thanks @@Luke

Thanks @@pir8radio

 

Yes it's totally configuration related. Emby is working fine otherwise. I know it's a bit bordeline for Emby's support but this is the only forum with strong knowledge about emby and its related vhost configuration.

 

Yes I meant the web interface of Transmission

 

What else do you need apart from the vhost configuration ?

I have 2 other vhost that are not impacted by any change on emby or transmission vhost configuration, and the rest of the apache configuration is just ssl and includes statement in the main apache.conf file. I can copy paste everything if you need it but I'd surprised it helps.

 

I'm not really keen to switch to Nginx, not that I have specific needs for Apache, but I would like first to understand how to do something and not switch to a whole new solution just because I don't understand. I'm pretty sure few lines need to be modified to make this work :)

 

Edit : also the goal design if it helps

http://my.website/nextcloud -> https://my.website/nextcloud (working)

http://my.website/zabbix -> https://my.website/zabbix (working)

http://my.website/transmission -> https://my.website/transmission (which is also a redirect to http://127.0.0.1:9091/transmission) Working if enabled before Emby

http://my.website/emby -> https://my.website/transmission (which is also a redirect to http://127.0.0.1:8096) Working if enabled before Transmission

http://my.website/ -> you don't have the permission to access / on this server (as expected)

https://my.website/ -> you don't have the permission to access / on this server (as expected)

Edited by Okeur75
Link to comment
Share on other sites

  • Solution
Okeur75

Hello guys, I found the solution and wanted to share if someone needs it.

 

The issue was actually I have only one domain name and no subdomain. So there is no real vhost running on my server, just multiple website in different folders or as Emby, managed by their own web server. The issue was 2 vhost files both catching the same domain name, hence only the first one was catched and the second one ignore. That's why Emby was working when enabled first, and Transmission no working, or the opposite when Transmission was enabled first.

 

To sum up, here is the config file which is working in my case : Transmission torrent client running on 9091 + Emby running on 8920

<VirtualHost *:80>
        ServerName yoann.host
        ServerAlias www.yoann.host
        Redirect permanent /transmission https://yoann.host/transmission
        Redirect permanent /emby https://yoann.host/emby
</Virtualhost>

<VirtualHost *:443>
        ServerName yoann.host
        ServerAlias www.yoann.host
        Redirect permanent /transmission https://yoann.host/transmission
        Redirect permanent /emby https://yoann.host/emby

        ErrorLog ${APACHE_LOG_DIR}/transmission_emby_error_log
        LogFormat "%t \"%r\" %>s" common
        CustomLog ${APACHE_LOG_DIR}/transmission_emby_access_log common

        RewriteEngine on
        RewriteRule /transmission[/]?$ /transmission/web/ [R]
        RewriteRule ^/emby$ /emby/ [R]

        ProxyRequests On
        ProxyPreserveHost Off

        <Proxy *>
        Order allow,deny
        Allow from all
        </Proxy>

        <location /transmission>
                ProxyPass http://127.0.0.1:9091/transmission
                ProxyPassReverse http://127.0.0.1:9091/transmission
        </location>

        <location /emby>
                ProxyPass  http://127.0.0.1:8096/emby
                ProxyPassReverse  http://127.0.0.1:8096/emby
        </location>

        <location /embywebsocket>
                ProxyPass  http://127.0.0.1:8096/embywebsocket
                ProxyPassReverse  http://127.0.0.1:8096/embywebsocket
        </location>
</Virtualhost>

Glad if it helps someone and thanks to both of you guys for taking a look.

  • Like 1
Link to comment
Share on other sites

pir8radio

Hello guys, I found the solution and wanted to share if someone needs it.

 

The issue was actually I have only one domain name and no subdomain. So there is no real vhost running on my server, just multiple website in different folders or as Emby, managed by their own web server. The issue was 2 vhost files both catching the same domain name, hence only the first one was catched and the second one ignore. That's why Emby was working when enabled first, and Transmission no working, or the opposite when Transmission was enabled first.

 

To sum up, here is the config file which is working in my case : Transmission torrent client running on 9091 + Emby running on 8920


Glad if it helps someone and thanks to both of you guys for taking a look.

 

 

I think you might find some things not working correctly with a sub directory, vs using a sub domain     emby.domain.com, transmission.domain.com     But let us know how it goes..  :-)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...