Open chang-zhao opened 5 years ago
About root directive, it's easy to do this way:
In the html section -
map $host $root {
default *our real web root directory here*;
}
root $root;
This is enough for the localhost server. For additional servers use this code:
server_name ~^(?<domain>phpmyadmin)$;
root $root/$domain;
where instead of phpmyadmin can be any other name; they all will be mapped to a dir with such name in the root web folder ("html" or something).
The rest of individual "server" section could be the same or different, depending on the needs of particular site.
I am against the output nginx settings on the wnmp panel, becouse Nginx can be used for other purposes. I like the wnmp, because I can customize it how I want, without depend the interface.
I am against the output nginx settings on the wnmp panel, becouse Nginx can be used for other purposes. I like the wnmp, because I can customize it how I want, without depend the interface.
I see your point. What I'm proposing is that users could add quick links, it's like bookmarks right on the panel. If you don't want it you don't add it.
Though maybe it's not very important.
I see your point. What I'm proposing is that users could add quick links, it's like bookmarks right on the panel. If you don't want it you don't add it.
You gave very simple example. Users can use one config with unlimited local websites:
server_name ~^(?<domain>phpmyadmin)$;
root $root/$domain;
You gave very simple example. Users can use one config with unlimited local websites:
Yes. And for different servers, there may be the need for different configs - depending on the software (engines) installed; for example, one server has Joomla, another DokuWiki etc., they all have some fine-tuning directives.
Though maybe you are right and such configs shouldn't be bundled with the WNMP; it's better to describe such configs in the desriptions or WNMP Wiki, right?
OK, I have added Custom NGINX configurations page to the Wiki.
And the option to add custom bookmarks to WNMP maybe isn't worth the time & efforts.
However, see the note in "Custom NGINX configurations" about force redirect for phpMyAdmin. I experienced that "no-login" bug myself, so I suggest to add that force redirect to WNMP config.
I don't mind if this issue would be closed.
Thanks Kurt and all the Open Source guys out there!
1. Often users would like to add another local domain (not just one "localhost").
For that, it could be good to provide a sample config.
For example, in nginx.conf, after closing HTTPS server section, add
include domains\*.conf;
Make dir "domains" in "conf". Place there "phpmyadmin.conf" with server declaration, like
and so on. As for the "root" directive, it could be written on install, or user could be instructed how to adjust it. Likewise, deal with adding "127.0.0.1 phpmyadmin" to hosts file, and perhaps a GUI control to edit hosts file.
This way novice users would have great help in setup.
2. Then maybe it's useful to add a configurable shortcut menu to that "localhost" link in GUI. For example, WNMP could read/write in its config file something like
(label, address)
Thank you again, Kurt!