Welcome! Log In Create A New Profile

Advanced

Nginx Reverse Proxy (proxy_pass)

November 16, 2023 05:19PM
Hello everyone,
i have a Yamaha Musiccast box in the WLAN. I can address this via the IP address 192.168.30.173 port 80. I would like to switch access to https. I cannot make any configurations on the website. Now my idea was to set up a reverse proxy via my Nginx web server. My web server runs on the 192.168.20.0/24 network. Here I have set up the IP address 192.168.20.173 (FQDN:mcbme01.intern.examle.com) for the reverse proxy as follows.
...
root@dsme01:~# cat /etc/nginx/sites-available/mc.conf
server {
# Update this line to be your domain
server_name mcbme01.intern.example.com;
# These shouldn't need to be changed
listen mcbme01.intern.example.com:80;
return 301 https://$host$request_uri;
}
server {
server_name mcbme01.intern.example.com;
listen mcbme01.intern.example.com:443 ssl; # managed by Harbich
ssl_certificate /etc/ssl/certs/mcbme01.intern.example.com.crt; # managed by Harbich
ssl_certificate_key /etc/ssl/private/mcbme01.intern.example.com.key; # managed by Harbich
ssl_dhparam /etc/ssl/certs/dhparams.pem; # managed by Harbich
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
proxy_pass http://192.168.30.173;
}
}
...
Unfortunately, this doesn't work the way I imagine. Something doesn't seem to be working with the redirect.
...
dsme01.intern.example.com.45358 > 192.168.30.173.80: Flags [S], cksum 0x3a2a (correct), seq 219914398, win 64240, options [mss 1460,sackOK,TS val 3180282379 ecr 0,nop,wscale 7], length 0
192.168.30.173.80 > dsme01.intern.example.com.45358: Flags [S.], cksum 0xe0cf (correct), seq 2651179133, ack 219914399, win 14480, options [mss 1460,sackOK,TS val 183347774 ecr 3180282379,nop,wscale 2], length 0
dsme01.intern.example.com.45358 > 192.168.30.173.80: Flags [.], cksum 0x4627 (correct), seq 1, ack 1, win 502, options [nop,nop,TS val 3180282389 ecr 183347774], length 0
dsme01.intern.example.com.45358 > 192.168.30.173.80: Flags [P.], cksum 0x903b (correct), seq 1:875, ack 1, win 502, options [nop,nop,TS val 3180282389 ecr 183347774], length 874: HTTP, length: 874
192.168.30.173.80 > dsme01.intern.example.com.45358: Flags [.], cksum 0x34ce (correct), seq 1, ack 875, win 4057, options [nop,nop,TS val 183347786 ecr 3180282389], length 0
192.168.30.173.80 > dsme01.intern.example.com.45358: Flags [P.], cksum 0x8b95 (correct), seq 1:145, ack 875, win 4057, options [nop,nop,TS val 183347786 ecr 3180282389], length 144: HTTP, length: 144
dsme01.intern.example.com.45358 > 192.168.30.173.80: Flags [.], cksum 0x41b7 (correct), seq 875, ack 145, win 501, options [nop,nop,TS val 3180282496 ecr 183347786], length 0
dsme01.intern.example.com.45358 > 192.168.30.173.80: Flags [F.], cksum 0x41b6 (correct), seq 875, ack 145, win 501, options [nop,nop,TS val 3180282496 ecr 183347786], length 0
192.168.30.173.80 > dsme01.intern.example.com.45358: Flags [F.], cksum 0x33cf (correct), seq 145, ack 876, win 4057, options [nop,nop,TS val 183347788 ecr 3180282496], length 0
dsme01.intern.example.com.45358 > 192.168.30.173.80: Flags [.], cksum 0x4195 (correct), seq 876, ack 146, win 501, options [nop,nop,TS val 3180282526 ecr 183347788], length 0
...
In the tcpdump I see connections to the IP of the Yamaha Musiccast Box via port 80 but in the browser I see the following message:
...
The website is not accessible
The webpage at https://mcbme01.intern.example.com/ may be temporarily unavailable or may have been permanently moved to a new web address.
ERR_INVALID_RESPONSE
...
The FQDN: dsme01.intern.example.com has the IP address 192.168.20.20. Is there something wrong with my mc.conf from Nginx server? I would be very happy about any help.

Greetings from Stefan Harbich
Subject Author Posted

Nginx Reverse Proxy (proxy_pass)

sharbich November 16, 2023 05:19PM

Re: Nginx Reverse Proxy (proxy_pass)

sharbich November 22, 2023 02:41PM

Nginx as a Reverse Proxy or Jump server

muhammadimtiaz.ahmed93 November 28, 2023 07:52AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 189
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready