modified: Added name section
parent
214aef33ad
commit
8de3989f22
@ -0,0 +1,52 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
conf_path="/etc/nginx/conf.d/$1.conf"
|
||||||
|
|
||||||
|
if [ -f "$conf_path" ]
|
||||||
|
then
|
||||||
|
conf_text=`cat $conf_path`
|
||||||
|
if [[ "$conf_text" == *"$2"* ]] || [[ "$conf_text" == *"localhost:$3"* ]]
|
||||||
|
then
|
||||||
|
echo "Proxy route or localhost port has been used, please manually reconfigure your Nginx configuration."
|
||||||
|
else
|
||||||
|
word="\n\n\tlocation \/$2\/ {\
|
||||||
|
\n\t\tproxy_pass http:\/\/localhost:$3\/;\
|
||||||
|
\n\t}"
|
||||||
|
match="# Insert here"
|
||||||
|
echo "$conf_text" | sed "s/$match/&$word/g" > "$conf_path"
|
||||||
|
fi
|
||||||
|
|
||||||
|
nginx -t
|
||||||
|
systemctl reload nginx
|
||||||
|
else
|
||||||
|
conf_text="server {
|
||||||
|
listen 420;
|
||||||
|
listen [::]:420;
|
||||||
|
server_name $1;
|
||||||
|
|
||||||
|
# Load configuration files for the default server block.
|
||||||
|
include /etc/nginx/default.d/*.conf;
|
||||||
|
|
||||||
|
# Insert here
|
||||||
|
|
||||||
|
location /$2/ {
|
||||||
|
proxy_pass http://localhost:$3/;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 404 /404.html;
|
||||||
|
location = /40x.html {
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
|
||||||
|
echo "$conf_text" > "$conf_path"
|
||||||
|
|
||||||
|
chcon unconfined_u:object_r:httpd_config_t:s0 "$conf_path"
|
||||||
|
chown root:root "$conf_path"
|
||||||
|
|
||||||
|
nginx -t
|
||||||
|
systemctl reload nginx
|
||||||
|
fi
|
||||||
|
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,100 @@
|
|||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 15px 20px;
|
||||||
|
font-size: 18px;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
transition: background-color 0.3s ease;
|
||||||
|
margin: 10px;
|
||||||
|
width: 200px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button img {
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: light) {
|
||||||
|
body {
|
||||||
|
color: #ff5a99;
|
||||||
|
background-color: #fff3f9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button{
|
||||||
|
color: #fff3f9;
|
||||||
|
background-color: #ffa7c7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button:hover{
|
||||||
|
background-color: #ff5a99;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer{
|
||||||
|
color: #ffa7c7;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer a:link{
|
||||||
|
color:#ff5a99
|
||||||
|
}
|
||||||
|
|
||||||
|
footer a:visited{
|
||||||
|
color: #ffa7c7;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer a:hover{
|
||||||
|
color:#ff5a99
|
||||||
|
}
|
||||||
|
|
||||||
|
footer a:active{
|
||||||
|
color:#ff5a99
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
body {
|
||||||
|
color: #00d791;
|
||||||
|
background-color: #060606;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button{
|
||||||
|
color: #060606;
|
||||||
|
background-color: #00d791;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button:hover{
|
||||||
|
background-color: #00d791;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer{
|
||||||
|
color: #55052c;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer a:link{
|
||||||
|
color: #00d791;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer a:visited{
|
||||||
|
color: #55052c;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer a:hover{
|
||||||
|
color: #00d791;
|
||||||
|
}
|
||||||
|
|
||||||
|
footer a:active{
|
||||||
|
color: #00d791;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue