Nginx and other servers

Hi all

I have built an Nginx server but am having trouble getting it to serve sites that are on other servers.
I have created a config file to serve a local page which works fine - I get the Nginx default page just fine.
I added into the config by copying the default at the top of the config and added proxy_pass and http://other.ip.of.server to see if it would serve the page on the other server.
It does, but it doesn’t automatically switch to SSL, in fact if you go to http:// other server I get the default Nginx page if I go to https then I get served the correct page. So I’m not sure on how to make it automatically switch to https.
I have commented out all port 80 things in my server block config.
Also when I visit the https web site through Nginx, the default page has a certificate but the page I am tying to access via https (test.mydomain.com) doesn’t get the cert.

Not done this before so not sure what I need to do.

Help greatly appreciated.
Thanks.

Can you post your configuration, if possible?

Can you tell us more about your setup – where is your client in relation to your server?

Posting of your nginx.conf file would also be great. It sounds like you are setting up a reverse proxy. Is SSL going to terminate at the reverse proxy, do you want to pass it through to the backend or do you want it to terminate and then re-encrypt to the backend?

Exactly this.

I can post my config later on when I am in front of the server.

My Web serversa re all on the same network and subnet… Yes I want SSL to be termindated on the proxy and passed to which ever web app is being displayed.

Ill post my config asap, at the moment it is just default.

Thanks

Although there are many guides to setting up SSL terminating Nginx reverse proxies, I think this particular guide is pretty helpful and uses good security practices in setting one up:

Thanks guys

I have been playing with this tonight and I have got SSL working - I needed A wildcard Cert for that to work.
I have one web app working fine, but my main website is loading but only so far. THats through NGinx my site works perfectly fine when not being proxied through NGInx. My site loads to a point then stops. Site is hosted on another server on same network as my NGinx VM.

You’d have to post your nginx conf file and any other files you made for your reverse proxy. Hard to know what’s happening without the config and/or log files

1 Like