fix: config template parse issue

This commit is contained in:
0xJacky 2023-01-05 20:47:33 +08:00
parent b16536b1f0
commit b5508b7366
No known key found for this signature in database
GPG key ID: B6E4A6E4A561BAF0
17 changed files with 184 additions and 398 deletions

View file

@ -4,23 +4,14 @@
# Description[zh_CN]: Nginx UI 配置模板
# Author: @0xJacky
# Nginx UI Template End
# Nginx UI Custom Start
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
listen [::]:80;
server_name ;
rewrite ^(.*)$ https://$host$1 permanent;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ;
ssl_certificate ;
ssl_certificate_key ;
location / {
# Nginx UI Custom End
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@ -29,5 +20,4 @@ server {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass http://127.0.0.1:9000/;
}
}

View file

@ -0,0 +1,12 @@
# Nginx UI Template Start
# Name: WordPress
# Description[en]: WordPress Config Template
# Description[zh_CN]: WordPress 配置模板
# Author: @0xJacky
# Nginx UI Template End
location / {
try_files $uri $uri/ /index.php?$args;
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

View file

@ -1,45 +0,0 @@
# Nginx UI Template Start
# Name: WordPress-PHP8.1
# Description[en]: WordPress PHP 8.1 Config Template
# Description[zh_CN]: WordPress PHP 8.1 配置模板
# Author: @0xJacky
# Nginx UI Template End
server {
listen 80;
listen [::]:80;
server_name ;
rewrite ^(.*)$ https://$host$1 permanent;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ;
ssl_certificate ;
ssl_certificate_key ;
root ;
index index.php;
location ~ [^/]\.php(/|$) {
try_files $uri =404;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location /.well-known {
proxy_set_header Host $host;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr:$remote_port;
proxy_pass http://127.0.0.1:{{ HTTP01PORT }};
}
}