YCAST with NGINX

I am trying to get YCAST up and running with NGINX. I have followed this tutorial which uses DDWRT. I'm a little lost on OpenWRT without a GUI for NGINX.
My config file is here:
/mnt/sda1/ycast-nginx.conf

NGINX installation did not create a configuration file, must it be created?
/etc/nginx/nginx.conf

At this stage the test gives this:

~# nginx -t -c /mnt/sda1/ycast-nginx.conf
2021/01/31 10:28:30 [emerg] 10329#0: open() "/tmp/etc/nginx/mime.types" failed (                                                                                                                                                             2: No such file or directory) in /mnt/sda1/ycast-nginx.conf:13
nginx: configuration file /mnt/sda1/ycast-nginx.conf test failed

Any help is welcome.

You also need to provide on /tmp/etc/nginx file mime.types too.

Nginx complaings that he can't find file /tmp/etc/nginx/mime.types

After a lot of time spent on NGINX I think it's a bit too complicated for me.
Maybe dnsmasq can help me reach my goal in 2 steps.
Step 1: intercept requests to VTUNER
Step 2: redirect requests to my Ycast server installed on a Raspberry.

The first step is solved by editing the file: /ect/dnsmasq.conf
address=/.vtuner.com/192.168.1.1

I have no solution for the second step and any help is welcome.
Thank you.

Instead of this address, put the address of your Pi running YCAST... Done!

1 Like

Surely this is a good lead.

>nslookup yradio.vtuner.com
Serveur :   WNDR3700.lan
Address:  fd52:7cxx:xxxx::1

Nom :    yradio.vtuner.com
Address:  192.168.1.1

When I redirect to the Pi

>nslookup yradio.vtuner.com
Serveur :   WNDR3700.lan
Address:  fd52:7cxx:xxxx::1

Nom :    yradio.vtuner.com
Address:  192.168.1.24

But it looks like I still have something to do. My Denon AV-Receiver does not retrieve the station list.
It works fine through a browser.
http://192.168.1.24:8010/

Perhaps you need to intercept more DNS names?

All DNS servers have in common:
.vtuner.com
What is incomprehensible is that I completely lose the internet connection when I try:
address=/.vtuner.com/192.168.1.24:8010

>nslookup yradio.vtuner.com
DNS request timed out.
    timeout was 2 seconds.
Serveur :   UnKnown
Address:  fd52:7cxx:xxxx::1

DNS request timed out.
    timeout was 2 seconds.

DNS have nothing to do with ports, you cannot append the port no after the IP.

Are you sure the denon doesn't do some kind of challange, your ycast doesn't answer to, as it should.
You'll never catch it unless you start to sniff the traffic.

Check out clodshark or tcpdump.

1 Like

I have a lot of data with WIRESHARK but I don't know exactly what to look at.
Here's what NGINX should have done:

ycast-nginx.conf

server {
        listen 80;
        server_name *.vtuner.com;

        access_log /var/log/nginx/ycast_access.log;
        error_log /var/log/nginx/ycast_error.log;

        location / {
                proxy_redirect  off;

                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_set_header X-Forwarded-Proto $scheme;

                proxy_pass http://192.168.1.24:8010;
        }
}

My efforts with NGINX are in vain. So I switched to pi-hole which is more affordable for my level. I created a new topic.