mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
fix: config template parse issue
This commit is contained in:
parent
b16536b1f0
commit
b5508b7366
17 changed files with 184 additions and 398 deletions
|
@ -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/;
|
||||
}
|
||||
}
|
12
template/block/wordpress.conf
Normal file
12
template/block/wordpress.conf
Normal 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;
|
|
@ -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 }};
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue