SOLVED Nginx custom path

HikariNass

Cadet
Joined
Jan 20, 2024
Messages
6
Hello everybody! so I have a volume called APP where my Nginx container is stored and I have another volume called storage I wanted to know if it was possible to configure Nginx to put the html and php files in the storage volume rather than app thank you!
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
In your app config, you need to look at the Storage (or Storage and Persistence) section and mount a directory (host path type) from wherever you want into the container at the specified location.

Seems that would get you exactly what you're asking for.
 

HikariNass

Cadet
Joined
Jan 20, 2024
Messages
6
Thank you for answering so quickly! even if I enter in host path /mnt/Storage/Public and Mount Path /mnt/Storage/Public/www the nginx page does not change it is always the same which congratulates us for having installed nginx we must not change the configuration of nginx if yes how do we access the .conf file through a pod shell thanks in advance
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
OK. We need to get some things straight here...

What container are you running (is it a custom app? or is it an app supplied from one of the catalogs?)

Are you just wanting to use the default config as provided by that container and insert your web contents into the directory it's already publishing? or are you really just interested in editing the config in a way that persists to point at your mounted content?
 

HikariNass

Cadet
Joined
Jan 20, 2024
Messages
6
OK. We need to get some things straight here...

What container are you running (is it a custom app? or is it an app supplied from one of the catalogs?)

Are you just wanting to use the default config as provided by that container and insert your web contents into the directory it's already publishing? or are you really just interested in editing the config in a way that persists to point at your mounted content?

No problem so to start I have 2 pools one called apps the other called storage I installed the docker image on the apps pool because it is an ssd but this pool is limited to 500GB however I would like the files for my website to be on Storage which has 4TB of storage and as my website is going to be quite heavy I would therefore like to store the files on the Storage pool, thank you very much for spending your time on me
 
Last edited:

LordJabu

Cadet
Joined
Jan 9, 2024
Messages
4
Hello everybody! so I have a volume called APP where my Nginx container is stored and I have another volume called storage I wanted to know if it was possible to configure Nginx to put the html and php files in the storage volume rather than app thank you!
It seems like you're trying to do the same thing as I am. I also made a post the other day having issues with host paths. It would be interesting to see if you run into the same problem I have.
 

HikariNass

Cadet
Joined
Jan 20, 2024
Messages
6
It seems like you're trying to do the same thing as I am. I also made a post the other day having issues with host paths. It would be interesting to see if you run into the same problem I have.

Actually it's the same problem I'm not a pro either I don't even know how to configure in the pod shell so it's already a bit complicated to find a solution I would like to try installing Apache to see if it works if you can do your mapping by any means let me know
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
This can't possibly be any simpler, but here are the screenshots:

Put your contents in /mnt/pool/dataset/webapp (or whatever path you will use for the host path you mount.

Create a new custom app:

Use nginx for the image repository
1706093049370.png


Under Port Forwarding, add at least one to forward the container port 80 to something above 9000 (I chose 40080), do the same for port 443 if you want to publish https/TLS.
1706093068740.png


Under Storage, add a host path and point it at your chosen host path, mounting it to /usr/share/nginx/html:
1706093099345.png



Save the app and visit your TrueNAS IP at port 40080 http://192.168.0.2:40080/ to view the contents of your host path.

1706093211813.png
 

HikariNass

Cadet
Joined
Jan 20, 2024
Messages
6
This can't possibly be any simpler, but here are the screenshots:

Put your contents in /mnt/pool/dataset/webapp (or whatever path you will use for the host path you mount.

Create a new custom app:

Use nginx for the image repository
View attachment 75002

Under Port Forwarding, add at least one to forward the container port 80 to something above 9000 (I chose 40080), do the same for port 443 if you want to publish https/TLS.
View attachment 75003

Under Storage, add a host path and point it at your chosen host path, mounting it to /usr/share/nginx/html:
View attachment 75004


Save the app and visit your TrueNAS IP at port 40080 http://192.168.0.2:40080/ to view the contents of your host path.

View attachment 75006

Amazing it works thank you so much for your help you are amazing!
 
Top