I can't figure out this php script


A friend of mine setup the droplet I currently have and gave me a script so I could easily manage vhosts, its been a long time since I’ve done any of this and my friend has since passed in a car accident so I can’t ask him for help.

The script:

I can’t figure out how to use the script or how it works (beyond setting up a ngnix vhost)

I’d appreciate any help!


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

hi, this a script that creates sub-domain & nginx server block for that automatically.

for example, you have an application that need separate server block & directory for each user/subscriber. if you have that script, you dont need to create server bocks for each users manually. it will automatically create a sub-domain, a root directory for that, a server block and symlink that server block to yours sites-enabled. just you need to run that script/ bash upon user registration.

this is config for nginx !!! or what