-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Use as Website host / Web server directly #58
Comments
I can see adding support for static sites. This would be a nice feature. Setting fast-cgi parameters may even be a nice enhancement. But executing php, ruby, node, etc should not be in the scope of this project. It should be done in its own docker container. Just add it to your docker-compose file. Or consider using Caddy @TheBlueKingLP with a php backend container. |
Yep :) I agree that if I open the floodgates with PHP support, I'd have to do it for others as well. Not to mention that PHP with Nginx requires yet another process to be running in the background and I'm not sure about other cgi handlers but I'd guess they might need them too. This doesn't make the proxy a lightweight solution. I can see value in adding basic html support though. Seems overkill to spin up another docker container just to spit out plain text html files. Adding this feature costs nothing. In future it might be possible to build spin-off docker images that extend the base functionality, so you might have |
Yes please, static site, mapped in container path. |
It would be great! This is the thing I'm missing the most. I started up this image and I quickly realized "wait a minute, I don't have that many proxies". I have a wordpress website, a simple domain that makes a folder browseable, and some subdomains that are proxies but yeah... I'm conflicted now because the bulk of my configuration wouldn't be managed by the UI :( So please, consider adding this website host feature, optionally with the spin-off docker images you mentioned! Let me know if you require assistance! |
At first I wanted static sites to be supported but I get why they're not, it would mean your nginx container would need to have a bunch of volumes attached to it for each static site, or just 1 volume for all of them, and that defeats the modular purpose of docker. What I'm doing is running this, proxying to a certain ip, which then runs another deployment of an nginx container with 1 static site in it, so each static site gets its own nginx process and ip, effectively turning static sites into ip address sites. Now then yeah you have to manage that config through text but managing one site's config through files is alright compared to managing numerous load-balanced proxies on your nginx-proxy-manager instance. Just my thoughts |
I've been doing this following for quite some time in my 404 hosts to enable some simple static hosting
Note: This will likely break your preset settings such as "Force SSL" settings for this host. (although certificates will work fine) For PHP supportMy docker compose is slightly different, I've added PHP FPM in a seperate container, and I'm exposing the host's /var/www directory to both the app and php container (the directory could be anything, but this is what I chose to use)
Finally, for those hosts that you would like to enable PHP on, you should use something like the following in the advanced tab
I quite like that I can mix and match PHP and non-PHP sites quite easily on the same host. There may be a more elegant solution but this is what I've been using for quite some time, so thought I'd share it. |
@jc21, without php support? will it be okay to add the static html files. (may be generated by fronted framework) can we add another scheme here as path. (i know that scheme is not an appropriate term but,) then update the path provided there and update the template file ?? |
I agree with @ssrahul96 and think that a file scheme with only a required path box would be ideal. I would also like to suggest adding this to the custom locations as well (though in its template it would be alias instead of root). I would also suggest that no default location / or such be added, I believe file should be considered and "advanced" scheme and require any additional setup be done in the appropriate advanced configuration box. |
I've been thinking about adding a file host, with an optional FPM style handler. I'd default to /var/www (Hello world!) and allow a user to change the location. Haven't thought it through too much, but would be interested in seeing others input before committing to a PR. |
I have been giving this a think for the past few days, and I think the following would work: As for FPM, there are some "basic" options you could provide, but I think that most of the time people would need to copy/paste a setup that is specific to the app they are forwarding, so I still feel this should be left as an "advanced" procedure. Would you agree that this is a good starting point, and something you could make a PR for? |
We need another host type. File host. it could take a simple path that needs to be accessible for a start. |
Has there been any work on this? Is there any where I could lend my efforts to help get this feature added? |
Having this would make this a full nginx manager. I understand that having fast cgi backends would significantly increase maintenance effort. The easiest way to do it would be to declare simple static sites plus the ability to declare fastcgi backends. And let the fastcgi service to be configured by the user as a separate backend that is not managed by npm. The other issue would be that we would need custom directives per domain/backend. It's very common to require special config to support pretty URLs, secure sensitive data, define compression, and so on. I am currently using Caddy for this reason, but I would love to have alternatives, especially with the speed and gravity of nginx. |
Issue is now considered stale. If you want to keep it open, please comment 👍 |
Default WWW/root folder/directory for docker container managed by Nginx Proxy Manager is |
I would like to see website host in this docker
It should be like the proxy host, but instead of asking you for the Scheme,Forward Hostname / IP and Forward Port, it should ask for a path for the website contents.
It should also support php7 for hosting php files.
The text was updated successfully, but these errors were encountered: