You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Okay, so I knew next to nothing about networking as of 6~ months ago and now I know slightly more than nothing. I had things working with my Domain Registrars DNS settings going to vanilla NginX as a reverse proxy. I then moved my DNS provider (maybe, not sure if that's the right terminology) to Cloudflare. Then I broke some things and, as I needed to basically redo all my settings anyway, decided to try moving to NPM. The problem I now have is I can't seem to do what I want to and I'm not sure which of the following is the issue. Either:
a) I'm trying to be very dumb and NPM won't let me.
b) I'm not trying to be very dumb, and NPM isn't the tool for me.
c) I'm actually smart and NPM is the problem
So, what I am trying to achieve is this.
I have customdomain.tld. I also have sub subdomain. What I want to do in my head is:
Have www.customdomain.tld and customdomain.tld send the user to customdomain.tld/landing_page which will pass to an NginX instance hosting a simple HTML page. I also want sub.customdomain.tld to redirect to customdomain.tld/landing_page#sub. I then want sub.customdomain.tld/app1, sub.customdomain.tld/app2, sub.customdomain.tld/app3, etc. to forward the user to the appropriate webpage via proxypass to a docker container.
My understanding of this is that I should use something like a 301 redirect for the addresses I want to point to the landing_page subpath but I want normal proxypasses for the subpaths on the subdomain but when I try and set the base domain as a redirect I can no longer set up proxypasses for the subpaths. And if I try to set things up 'backwards' to at least test things I get sent to customdomain.tld/landing_page/landing_page/landing_page/landing_page... which, obviously, is wrong.
Should I be using something else, doing it differently, or using NPM better?
Also, yes I know NPM supports custom configuring with the advanced section but if I'm going to be doing all this by hand I might as well move back to NginX anyway.
Update:
So after playing with NPM some more I've made some more progess.
It seems the best way to handle things for my usecase is to just manually set them in the 'advanced' section of a normal Proxy Host. Just sticking:
there seems to handle that part fine. Otherwise, I can handle subpaths as I expected (and, obviously, ssl and the rest easily enough as normal.)
I'm now stuck with a new issue that I cannot figure out for the life of me which I'm not sure if is my own incompetence or a weird collision of other issues. My goal is to, as previously mentioned, use Cloudflare's AnyCast Proxy Network thing to proxy requests from my custom domain name to my NPM instance (I hope adding an air-gap to hide my IP and provide a level of extra protection against (D)DoS attacks and such.) and then from NPM to my docker hosted services. The only issue I'm now having, somehow, is simply hosting (an) html webpage(s) with NginX behind NPM. If anyone can help explain what I should and should not be doing with that I'd greatly appreciate it!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Okay, so I knew next to nothing about networking as of 6~ months ago and now I know slightly more than nothing. I had things working with my Domain Registrars DNS settings going to vanilla NginX as a reverse proxy. I then moved my DNS provider (maybe, not sure if that's the right terminology) to Cloudflare. Then I broke some things and, as I needed to basically redo all my settings anyway, decided to try moving to NPM. The problem I now have is I can't seem to do what I want to and I'm not sure which of the following is the issue. Either:
a) I'm trying to be very dumb and NPM won't let me.
b) I'm not trying to be very dumb, and NPM isn't the tool for me.
c) I'm actually smart and NPM is the problem
So, what I am trying to achieve is this.
I have
customdomain.tld
. I also havesub
subdomain. What I want to do in my head is:Have
www.customdomain.tld
andcustomdomain.tld
send the user tocustomdomain.tld/landing_page
which will pass to an NginX instance hosting a simple HTML page. I also wantsub.customdomain.tld
to redirect tocustomdomain.tld/landing_page#sub
. I then wantsub.customdomain.tld/app1
,sub.customdomain.tld/app2
,sub.customdomain.tld/app3
, etc. to forward the user to the appropriate webpage via proxypass to a docker container.My understanding of this is that I should use something like a 301 redirect for the addresses I want to point to the
landing_page
subpath but I want normal proxypasses for the subpaths on the subdomain but when I try and set the base domain as a redirect I can no longer set up proxypasses for the subpaths. And if I try to set things up 'backwards' to at least test things I get sent tocustomdomain.tld/landing_page/landing_page/landing_page/landing_page...
which, obviously, is wrong.So, in short, if I want to do something like:
Should I be using something else, doing it differently, or using NPM better?
Also, yes I know NPM supports custom configuring with the advanced section but if I'm going to be doing all this by hand I might as well move back to NginX anyway.
Update:
So after playing with NPM some more I've made some more progess.
It seems the best way to handle things for my usecase is to just manually set them in the 'advanced' section of a normal Proxy Host. Just sticking:
there seems to handle that part fine. Otherwise, I can handle subpaths as I expected (and, obviously, ssl and the rest easily enough as normal.)
I'm now stuck with a new issue that I cannot figure out for the life of me which I'm not sure if is my own incompetence or a weird collision of other issues. My goal is to, as previously mentioned, use Cloudflare's AnyCast Proxy Network thing to proxy requests from my custom domain name to my NPM instance (I hope adding an air-gap to hide my IP and provide a level of extra protection against (D)DoS attacks and such.) and then from NPM to my docker hosted services. The only issue I'm now having, somehow, is simply hosting (an) html webpage(s) with NginX behind NPM. If anyone can help explain what I should and should not be doing with that I'd greatly appreciate it!
Beta Was this translation helpful? Give feedback.
All reactions