这是我前 2 周搭建的,一切正常,需科学访问
https://harley.xuanyuanhuangdi.org/配置如下,一开始我也有乱码情况,nginx 是 lnmp 脚本生成的,需要注射调#的内容就正常了:
<pre>
upstream halo {
server 127.0.0.1:8090;
}
server
{
listen 80;
#listen [::]:80;
server_name
harley.xuanyuanhuangdi.org ;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/
harley.xuanyuanhuangdi.org;
#include rewrite/none.conf;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
location / {
return 301 https://$host$request_uri;
}
access_log off;
}
server
{
listen 443 ssl http2;
#listen [::]:443 ssl http2;
server_name
harley.xuanyuanhuangdi.org ;
# index index.html index.htm index.php default.html default.htm default.php;
# root /home/wwwroot/
harley.xuanyuanhuangdi.org;
ssl_certificate /usr/local/nginx/conf/ssl/
harley.xuanyuanhuangdi.org/fullchain.cer; ssl_certificate_key /usr/local/nginx/conf/ssl/
harley.xuanyuanhuangdi.org/harley.xuanyuanhuangdi.org.key; ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers "TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TL$
ssl_session_cache builtin:1000 shared:SSL:10m;
# openssl dhparam -out /usr/local/nginx/conf/ssl/dhparam.pem 2048
ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;
# include rewrite/none.conf;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
# include enable-php.conf;
# location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
# {
# expires 30d;
# }
# location ~ .*\.(js|css)?$
# {
# expires 12h;
#}
# location ~ /.well-known {
# allow all;
# }
# location ~ /\.
# {
# deny all;
# }
location /shenfu1991 { #/ray 提供流量重定向功能,匹配转发翻墙流量,客户 $
proxy_redirect off;
proxy_pass http://127.0.0.1:10010;#翻墙流量转发给 10000 端口,v2ray 配>
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
}
location / {
proxy_pass http://halo;
proxy_set_header HOST $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
access_log off;
}
</pre>