1
spr1ngs OP 为啥复制进去是对的 发出来就乱的?
|
2
spr1ngs OP user nginx nginx;
worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name www.rockylinux.me; client_max_body_size 1024m; location / { 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; proxy_pass http://127.0.0.1:8090; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } server { listen 443 ssl; server_name rockylinux.me www.rockylinux.me; # 配置证书的源,已经存放在 /usr/local/nginx/conf/cert/下 ssl_certificate /usr/local/nginx/cert/rockylinux.me/cert1.pem; ssl_certificate_key /usr/local/nginx/cert/rockylinux.me/privkey1.pem; ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; location / { 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; proxy_pass http://127.0.0.1:8090/; } } } |
3
ysc3839 2022-11-06 21:12:21 +08:00 via Android
|
4
PendingOni 2022-11-06 21:30:05 +08:00
不打算一直走 https 重定向么?
|
5
July1991 2022-11-07 08:57:44 +08:00
这是我前 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> |
7
Foxkeh 2022-11-07 13:47:28 +08:00
看看 nginx 的日志 access.log 和 error.log 提示是什么原因呢?
|