NGINX RP as gateway to all my LAN services - nginx-reverse-proxy

I'm trying to setup a Reverse Proxy based on NGinx on a Raspberry.
What I have :
- 1 synology server at home (location 1)
- 1 synology server at one of my friends' home (location 2)
- 1 Raspberry with Raspbian & Nginx RP (RPi_NGinx)
- 1 Raspberry with Raspbian & self hosted Jitsi meet server (Rpi_Jitsi)
- 1 Raspberry with Raspbian & PiVPN (OpenVPN server)
- 1 Asus Router
I only have one external IP and one domain name (let's say: myowndomain.com) and I can set as many CNAME.
See Diagram
What I want to do is setup NGinx so I can
- connect from internet to my synology NAS (SynoHome) , using dsm.myowndomain.com
- connect from internet to my router , using rtr.myowndomain.com
- connect from internet to my jitsi meet self hosted server router , using jitsi.myowndomain.com
- connect from internet over VPN to other home ressources on my LAN using vpn.myowndomain.com
- make sure my other synology (SynoBackup) will continue to replicate with my SynoHome,
What I already did:
- Setup NGinx
- Configured some /etc/nginx/sites-available/xxx.myowndomain.com.conf,
- Configured some links on /etc/nginx/sites-enabled/xxx.myowndomain.com.conf,
- modified win/sys32/drivers/etc/host in order to test my setup from inside my network
All my xxx.myowndomain.com.conf look like:
server {
listen 80;
server_name dsm.myowndomain.com;
location / {
proxy_pass https://192.168.200.200:5001;
}
}
So far I can only access to my Synology Admin UI. All other uses cases tests leads either to 502 Bad Gateway, or to a deadloop (Asus Router WebGUI) that reloads the same page.
Some NGINX expert who wants to help a noob?
Thank you

Try it like this:
server {
listen 80;
server_name dsm.myowndomain.com;
location / {
proxy_pass https://192.168.200.200:5001/ /;
}
}

Related

WAMP SSL - LOCALHOST and connection problem from another VM

I set up 2 VMS connected to each others , ping is working on both machine.
After that , I set up a WAMP serveur on machine 1 and managed to configure SSL on it. It's working on local host as described on this tutorial.
https://zuziko.com/tutorials/how-to-enable-https-ssl-on-wamp-server/
Now my problem is i need to be able to connect from the browser of VM 2 on the wamp server with SSL.
That's where i have a problem.
From Vm2 when i connect to VM 1 ( 192.168.56.10:8080) it's working
when i connect to 192.168.56.10:443 i have a bad request.
I am missing something .. can someone point me out where to look ?
thank you very much
enter image description here

Is it possible to redirect a url (using IP) to another url (other IP)?

I want to access 2 webservices in a remote/private network from my local/private network:
remote webservice 1 (RWS1): 192.168.0.2:8083
remote webservice 2 (RWS2): 192.168.0.1:80
remote ssh client (RSC) : 192.168.0.2
local ssh server (LSS) : my.server.com (local: 192.168.1.1)
local webserver 1 (LWS1) : 192.168.0.1:80
access RWS1 (this is working)
ssh-client connects to ssh-server incl. port-forwarding:
RSC: ssh -R0.0.0.0:8080:192.168.0.2:8083 user#my.server.com
enable all local IPs to access port at "LSS": 192.168.1.1:8080:
LSS: socat TCP-LISTEN:8083,fork TCP:127.0.0.1:8080
now I am able to access "http://192.168.1.1:8083/" and what I get is the result of RWS1. As this web-application uses relative redirects, this is working perfectly!
access RWS2 (this is NOT working)
ssh-client connects to ssh-server incl. port-forwarding:
RSC: ssh -R0.0.0.0:8080:192.168.0.1:80 user#my.server.com
enable all local IPs to access port at "LSS": 192.168.1.1:8080:
LSS: sudo socat TCP-LISTEN:80,fork TCP:127.0.0.1:8080
now I am able to access "http://192.168.1.1/" and what I get is the result of RWS2 - but as this web-application uses absolute redirects to 192.168.0.1, I am immediately redirected to my local LWS1 (e.g. my browser accesses "http://192.168.1.1/", but RWS2 answers with a redirect to "http://192.168.0.1/html/index.html").
=> how to force my browser to map everything pointing to 192.168.0.1 to go to 192.168.1.1 ?
(the good thing is, that I do not have to deal with certificates, as connection is done via http :-) )
thanks
michael

Cannot connect to Apache on Google Compute Engine

I have set up a Google Compute Engine and installed Apache on the server.
(The server is running Windows 2008 Server and Apache is running as a service.)
I can connect the server using Remote Desktop. However, I am not able to connect to the webserver. (I have also installed a FileZilla FTP server, but annot connect to ftp either.)
I have opened access to ports 80 and 443 on the Windows firewall, and I have also opened access to the same ports on the VPC Network Firewall:
default-allow-http
Ingress
http-server
IP ranges: 0.0.0.0/0
tcp:80
Allow
1000
default-allow-https
Ingress
https-server
IP ranges: 0.0.0.0/0
tcp:443
Allow
1000
Still, I am not able to connect to the webserver. I cannot connect to the webserver when I am logged on using Remote Desktop and then trying to connect to 127.0.0.1, either.
I have a similar setup on a virtual server on Rackspace. There everything works as expected. Any tips on what I might be doing wrong?

F5 LTM on the same subnet

I am new to F5 BIG-IP, i can create the Virtual Server with pool and pool members to create a LTM for subnet A Virtual Server to subnet B servers.
But when i configure the Virtual Server to load balance the servers on the same subnet, it just not work, i can telnet the web server port 80 via the Virtual Server, but when i open it on web browser with the virtual ip, the page cannot be loaded.
The BIG-IP running at 9.3 version.
WORKING (Different Subnet)
Virtual Server: 192.168.1.10
Web Server A: 192.168.2.11
Web Server B: 192.168.2.12
NOT WORKING (Same Subnet)
Virtual Server: 192.168.1.10
Web Server A: 192.168.1.11
Web Server B: 192.168.1.12
I found the solution ! when create Virtual Server, i use the default settings, the configuration is Basic, so there is no SNAT settings. Switch to Advance Configuration, and select SNAT: Auto Map. then it works ! your server can keep their default gateway to the firewall or switch.

Apache home server connects to domain inside network and not out

Hello i have an old windows xp pc im trying to turn into a server for hobbyist purposes. I downloaded and installed the apache xampp 1.8 distribution. Once installed and tested that the localhost worked, I connected my domain to my servers ip. So my problem is when i tried to connect to my site on my pc on the same network, they all were able to load the domain/site inside the network successfully but when i have a pc thats outside the network try it fails. Any ideas?. thanks.
You have used a private IP instead of public IP so it does not get resolved to your server. You have to use a public IP (if you have a static IP from your provider you have to setup port forwarding on your router.) If you get the IP from DHCPD server you will need to use dynamic DNS and port forwarding.
More info on private networks: http://en.wikipedia.org/wiki/Private_network