This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# replace all mentions of :domain with your domain with the following command: | |
# sed -i "s/:domain/${DOMAIN}/g" /etc/nginx/sites-available/${DOMAIN} | |
server { | |
root /var/www/:domain/public; | |
index index.php index.html index.htm; | |
server_name :domain www.:domain; | |
location / { | |
try_files $uri $uri/ /index.php?args; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Create a NGINX file, index.php and mysql DB for $DOMAIN passed in first argument e.g | |
# sudo bash create.sh domain.co.uk | |
# needs /root/.my.conf set up with [client] root user and password to create DB | |
# needs certbot installed to do certbot | |
DOMAIN=$1 | |
cp /etc/nginx/sites-available/basic /etc/nginx/sites-available/${DOMAIN} | |
sed -i "s/:domain/${DOMAIN}/g" /etc/nginx/sites-available/${DOMAIN} | |
ln -s /etc/nginx/sites-available/${DOMAIN} /etc/nginx/sites-enabled/${DOMAIN} |
NewerOlder