NGINX Reverse Proxy to Dynamic DNS

Server Fault Asked by Tempster102 on September 23, 2020

I have a VPS that hosts my personal portfolio. My DNS (*) is set to point to the VPS’s IP. I’m also setting up some local self-hosted (Off a NAS in my home) applications such as Cloud storage and sync, etc… I would like to use the NGINX server already running on the VPS to resolve to these local self-hosted services but since they are at home they are on a a dynamic IP from my ISP.

I would like to do the follow:

I’ve been reading the NGINX docs, reddit and posts on ServerFault but can’t wrap my head around the setup. I would also like for both above URL to use my SSL certificate; note I don’t have a wildcard certificate which is why I’m not using sub domains.


One Answer

Once you've sorted your issue with your IP, either asking for a static or using a service like No-IP, you'll want an Nginx conf like this... (You'll have to add your ssl configuration, but I'm guessing you know how to do that)

server {
  listen 443;
    location /cloud {
      proxy_pass <insert NAS public ip / no-ip hostname here>:<port if needed>;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto https;

Answered by Joe Brailsford on September 23, 2020

Add your own answers!

Related Questions

Prometheus container connection refused

1  Asked on December 9, 2021 by tyr_90


Postfix as incoming and outgoing relay

1  Asked on December 9, 2021 by meilon


Compile error on nginx-auth-ldap with nginx

1  Asked on December 9, 2021 by tuckson


How to route outgoing traffic through another server?

1  Asked on December 9, 2021 by mkopriva


Using OpenResty with previously installed nginx?

0  Asked on December 9, 2021 by simo


Perfmon not logging to SQL Server

2  Asked on December 7, 2021 by sean-long


Database Migration for Grafana

2  Asked on December 7, 2021 by chandan-singh


Cannot get groups from LDAP

1  Asked on December 7, 2021 by oscarcy


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir