[GH-ISSUE #141] Auto Provisioning Conf files #7198

Closed
opened 2026-03-12 19:30:33 +03:00 by kerem · 1 comment
Owner

Originally created by @AlexTryHarder on GitHub (Jul 11, 2023).
Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/141

Would it be possible to provision a website by filling custom form in UI?
At the moment I'm using a script, but it requires me to log in to SSH every single time.

`#!/bin/sh
echo "Domain:"
read domain
mkdir /var/www/html/$domain

touch /etc/nginx/sites-available/$domain.conf

cat </etc/nginx/sites-available/$domain.conf
server {
listen 80;
root /var/www/html/$domain;
index index.html index.htm;
server_name $domain www.$domain;
error_page 404 /404.html;

location / {
try_files $uri $uri/ =404;
}

}
EOF

ln -s /etc/nginx/sites-available/$domain.conf /etc/nginx/sites-enabled/
systemctl restart nginx`

Originally created by @AlexTryHarder on GitHub (Jul 11, 2023). Original GitHub issue: https://github.com/0xJacky/nginx-ui/issues/141 Would it be possible to provision a website by filling custom form in UI? At the moment I'm using a script, but it requires me to log in to SSH every single time. `#!/bin/sh echo "Domain:" read domain mkdir /var/www/html/$domain touch /etc/nginx/sites-available/$domain.conf cat <<EOF >/etc/nginx/sites-available/$domain.conf server { listen 80; root /var/www/html/$domain; index index.html index.htm; server_name $domain www.$domain; error_page 404 /404.html; location / { try_files \$uri \$uri/ =404; } } EOF ln -s /etc/nginx/sites-available/$domain.conf /etc/nginx/sites-enabled/ systemctl restart nginx`
kerem 2026-03-12 19:30:33 +03:00
Author
Owner

@0xJacky commented on GitHub (Jul 11, 2023):

Hello, I believe there may be some misunderstanding. If you're looking to add a new site configuration, you can easily do so by navigating to 'Manage Sites > Add Site', and subsequently filling out the provided form. The Nginx UI will then generate a configuration file and place it in the /etc/nginx/sites-available directory.

Following this, the program will activate your new site configuration by creating a soft link to the /etc/nginx/sites-enabled directory. Finally, Nginx will be automatically reloaded by Nginx UI.

<!-- gh-comment-id:1631117264 --> @0xJacky commented on GitHub (Jul 11, 2023): Hello, I believe there may be some misunderstanding. If you're looking to add a new site configuration, you can easily do so by navigating to 'Manage Sites > Add Site', and subsequently filling out the provided form. The Nginx UI will then generate a configuration file and place it in the /etc/nginx/sites-available directory. Following this, the program will activate your new site configuration by creating a soft link to the /etc/nginx/sites-enabled directory. Finally, Nginx will be automatically reloaded by Nginx UI.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#7198
No description provided.