Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

HOW-TO: Set up NGINX to reverse proxy your jails w/ Certbot

ArgaWoW

Senior Member
Joined
Jul 4, 2015
Messages
443
Hey, did you set up the base URL in plexpy?
Hi,
I am not sure what you mean with "base URL". I can reach plexpy local with 192.168.1.200:8181.

This is my proxy_setup.conf

location /plexpy {
proxy_pass http://192.168.1.200:8181;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 

ZodiacUHD

Member
Joined
Aug 28, 2015
Messages
197
Hi,
I am not sure what you mean with "base URL". I can reach plexpy local with 192.168.1.200:8181.

This is my proxy_setup.conf

location /plexpy {
proxy_pass http://192.168.1.200:8181;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
The conf is fine but you beed to go in plexpy's settings -> HTTP Root -> /plexpy/ It makes plexpy generate urls like 192.168.1.200:8181/plexpy. This way nginx will keep reverse proxying properly.
 

ArgaWoW

Senior Member
Joined
Jul 4, 2015
Messages
443
The conf is fine but you beed to go in plexpy's settings -> HTTP Root -> /plexpy/ It makes plexpy generate urls like 192.168.1.200:8181/plexpy. This way nginx will keep reverse proxying properly.
Hi, many thanks for reply
I tryed everything, but i am not able to get it work :/
I can reach plexpy sometimes with https://192.168.1.99/plexpy but I only get the login page and it takes very long (about 30 sec)

192.168.1.99 is the IP of my Proxy_Jail
 

ZodiacUHD

Member
Joined
Aug 28, 2015
Messages
197
Uhm, is the plexpy jail working fine if you connect locally to it without going through the reverse proxy? Are you using pfsense? Are you reversing anything else? If yes, do those applications work fine? Sorry for the long list of questions :)
 

ArgaWoW

Senior Member
Joined
Jul 4, 2015
Messages
443
Uhm, is the plexpy jail working fine if you connect locally to it without going through the reverse proxy? Are you using pfsense? Are you reversing anything else? If yes, do those applications work fine? Sorry for the long list of questions :)
your welcome :) I don't run plexpy in a jail. I have it running in a ubuntu vm as docker. And yes, everything runs fine without going through the proxy. With and without ssl.
 

ZodiacUHD

Member
Joined
Aug 28, 2015
Messages
197
Uhm, I honestly wouldn't know if that requires additional settings... i don't think i can help you with the docker. Have you tried with jails?
 

ArgaWoW

Senior Member
Joined
Jul 4, 2015
Messages
443
Uhm, I honestly wouldn't know if that requires additional settings... i don't think i can help you with the docker. Have you tried with jails?
I have done the setup again from scratch and now plexpy works. Greate !!!! :)

I am new on this term, so what are the best way to find out the right settings for my apps i want to use with this greate proxy?

- esxi host ui
- pyload
- portainer
- nextcloud
- iis for my asp.net web app

Thanks again for your help !
 

ZodiacUHD

Member
Joined
Aug 28, 2015
Messages
197
I have done the setup again from scratch and now plexpy works. Greate !!!! :)

I am new on this term, so what are the best way to find out the right settings for my apps i want to use with this greate proxy?

- esxi host ui
- pyload
- portainer
- nextcloud
- iis for my asp.net web app

Thanks again for your help !
I'm glad it is working well, about your settings i can tell you that the setup should be the same for all of them. You need to set up a base URL as you did in plexpy and then add the locations to your conf file in nginx. Of the programs you listed i'm only using nextcloud and i followed joshua's guide here on the forum (it is meant for owncloud but it works perfectly for NC as well).

If you have more specific questions i'll try to answer but i'm quite a novice as well so don't expect too much.
 

ArgaWoW

Senior Member
Joined
Jul 4, 2015
Messages
443
I'm glad it is working well, about your settings i can tell you that the setup should be the same for all of them. You need to set up a base URL as you did in plexpy and then add the locations to your conf file in nginx. Of the programs you listed i'm only using nextcloud and i followed joshua's guide here on the forum (it is meant for owncloud but it works perfectly for NC as well).

If you have more specific questions i'll try to answer but i'm quite a novice as well so don't expect too much.
I got nextcloud running with reverse proxy, now I am trying to handle my freenas gui also with his. But so far without success.

I tryed portainer (running as docker image) also no success

I need help for the following apps
- Esxi host ui
- freenas host ui
- portainer
- pyload
- ts3

It would be really great if some one can help a little ;)
 
Last edited:

ArgaWoW

Senior Member
Joined
Jul 4, 2015
Messages
443
I'm glad it is working well, about your settings i can tell you that the setup should be the same for all of them. You need to set up a base URL as you did in plexpy and then add the locations to your conf file in nginx. Of the programs you listed i'm only using nextcloud and i followed joshua's guide here on the forum (it is meant for owncloud but it works perfectly for NC as well).

If you have more specific questions i'll try to answer but i'm quite a novice as well so don't expect too much.
Hello... agian :)

Can you, or someone who knows about, please explain how the forward from the reverse_proxy to the client works and why some apps like nextcloud or plexpy works easyli and some others dont. I am still not able to set up me client from the post above :/

Thanks a lot :)
 

ZodiacUHD

Member
Joined
Aug 28, 2015
Messages
197
Hello... agian :)

Can you, or someone who knows about, please explain how the forward from the reverse_proxy to the client works and why some apps like nextcloud or plexpy works easyli and some others dont. I am still not able to set up me client from the post above :/

Thanks a lot :)
It essentially is a server that gets resources for the client from other servers. Honestly i don't know the other applications you mentioned nor the settings of those. As far as my knowledge goes, it's enough for the app to generate link with a specified url base and if you set the same in nginx, it will simply work. I was able to get everything working fine this way but, as i said, i'm only using jails.
 

ArgaWoW

Senior Member
Joined
Jul 4, 2015
Messages
443
It essentially is a server that gets resources for the client from other servers. Honestly i don't know the other applications you mentioned nor the settings of those. As far as my knowledge goes, it's enough for the app to generate link with a specified url base and if you set the same in nginx, it will simply work. I was able to get everything working fine this way but, as i said, i'm only using jails.
Hi, something other must be done too. I have my freenas on 192.168.1.220 when I set this in the proxy configuration I can't reach the Gui. I just get the nginx page of the proxy server.

I have ask Google but the information don't match to them what is am searching for (or I can't follow the explanation) :/

Still hope some one with more experience will find this tread and help a little.

At all I thank you very much for your time
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,361
You shouldn't be accessing your GUI externally, it's a security risk.
 

ArgaWoW

Senior Member
Joined
Jul 4, 2015
Messages
443
You shouldn't be accessing your GUI externally, it's a security risk.
I know about the risk, I just want to use it for testing the proxy.

But I have an another issue now. I have setup nextcloud with this proxy and at the begin it seems everything be alright, But now I get in the desktopclient heavy problems while the syncronisation:

Das Element ist aufgrund vorheriger Fehler nicht synchronisiert: Error transferring https://mydomain.eu/nextcloud/remote.php/dav/uploads/klimaflex/986169483/00000000 - server replied: Request Entity Too Large

I realy hope someone can help to solve this. If I use nextcloud without the proxy everything runs fine.

Thanks a lot
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,361
You need to adjust the max_upload_size and post_max_size settings in your php.ini file and the client_max_body_size in your nginx.conf file for larger uploads.
 

ArgaWoW

Senior Member
Joined
Jul 4, 2015
Messages
443
You need to adjust the max_upload_size and post_max_size settings in your php.ini file and the client_max_body_size in your nginx.conf file for larger uploads.
I only have deleted the ssl part in my old nginx.conf so I don't think this will be the reason for my issues.

Just for a test I removed all sync items from the desktop client and now it seems everything is working is going.

But thank you for your advice.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,361
Those things I posted have nothing to do with SSL. But glad you got it figured out...
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,361
Those things I posted have nothing to do with SSL. But glad you got it figured out...
 

ArgaWoW

Senior Member
Joined
Jul 4, 2015
Messages
443
Those things I posted have nothing to do with SSL. But glad you got it figured out...
I know, I just want to explain that the nginx.conf could not be the reason because it is the same as before I switched to the reverse proxy. Only the ssl settings has been changed.

(perhaps the misunderstanding depends on my English knowledge ) :/
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,361
The settings that I listed have to be changed on the nginx proxy configuration and the backend server configuration for large file uploads so it does very much matter.
 
Top