全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 1099|回复: 15

(江湖救急令)多网站反代+套CF,都是WP程序,伪静态出问题

[复制链接]
发表于 2021-11-15 14:58:12 | 显示全部楼层 |阅读模式
本帖最后由 leftgg 于 2021-11-15 15:02 编辑

后端服务器X (网站A,网站B,网站C)
前端服务器Y(网站A,网站B,网站C)
然后在套CF(网站A,网站B,网站C)





宝塔WORDPRESS伪静态无法保存,出现如下错误
  1. ERROR:
  2. nginx: [emerg] duplicate location "/" in /www/server/panel/vhost/rewrite/域名.com.conf:2
  3. nginx: configuration file /www/server/nginx/conf/nginx.conf test failed
复制代码


wp的伪静态规则
  1. location /
  2. {
  3.          try_files $uri $uri/ /index.php?$args;
  4. }

  5. rewrite /wp-admin$ $scheme://$host$uri/ permanent;
复制代码


后端服务器X IP 62.21.28.1
难道是前端服务器Y /etc/hosts里面配置的有问题吗?

62.21.28.1  域名a.com
62.21.28.1  域名b.com
62.21.28.1  域名c.com


发表于 2021-11-15 15:03:23 来自手机 | 显示全部楼层
给你提醒了,/重复了,你看还在哪配了
发表于 2021-11-15 15:04:54 | 显示全部楼层
location后面加空格
 楼主| 发表于 2021-11-15 15:08:12 | 显示全部楼层
0nline 发表于 2021-11-15 15:04
location后面加空格

有空格的,而且直接用官方,我没有任何改动的
 楼主| 发表于 2021-11-15 15:09:12 | 显示全部楼层
darius 发表于 2021-11-15 15:03
给你提醒了,/重复了,你看还在哪配了

nginx.conf这个里面查找是否有 /重复吗?
发表于 2021-11-15 15:10:17 来自手机 | 显示全部楼层
这个就不知道了
发表于 2021-11-15 15:11:37 | 显示全部楼层
屏蔽下敏感词,贴出来看看。
 楼主| 发表于 2021-11-15 15:19:14 | 显示全部楼层
0nline 发表于 2021-11-15 15:11
屏蔽下敏感词,贴出来看看。

还需要贴啥?我没有改任何东西呀除了域名和IP
 楼主| 发表于 2021-11-15 15:21:42 | 显示全部楼层
0nline 发表于 2021-11-15 15:11
屏蔽下敏感词,贴出来看看。

/www/server/nginx/conf/nginx.conf

  1. user  www www;
  2. worker_processes auto;
  3. error_log  /www/wwwlogs/nginx_error.log  crit;
  4. pid        /www/server/nginx/logs/nginx.pid;
  5. worker_rlimit_nofile 51200;

  6. stream {
  7.     log_format tcp_format '$time_local|$remote_addr|$protocol|$status|$bytes_sent|$bytes_received|$session_time|$upstream_addr|$upstream_bytes_sent|$upstream_bytes_received|$upstream_connect_time';
  8.   
  9.     access_log /www/wwwlogs/tcp-access.log tcp_format;
  10.     error_log /www/wwwlogs/tcp-error.log;
  11.     include /www/server/panel/vhost/nginx/tcp/*.conf;
  12. }

  13. events
  14.     {
  15.         use epoll;
  16.         worker_connections 51200;
  17.         multi_accept on;
  18.     }

  19. http
  20.     {
  21.         include       mime.types;
  22.                 #include luawaf.conf;

  23.                 include proxy.conf;

  24.         default_type  application/octet-stream;

  25.         server_names_hash_bucket_size 512;
  26.         client_header_buffer_size 32k;
  27.         large_client_header_buffers 4 32k;
  28.         client_max_body_size 50m;

  29.         sendfile   on;
  30.         tcp_nopush on;

  31.         keepalive_timeout 60;

  32.         tcp_nodelay on;

  33.         fastcgi_connect_timeout 7200;
  34.         fastcgi_send_timeout 7200;
  35.         fastcgi_read_timeout 7200;
  36.         fastcgi_buffer_size 64k;
  37.         fastcgi_buffers 4 64k;
  38.         fastcgi_busy_buffers_size 128k;
  39.         fastcgi_temp_file_write_size 256k;
  40.                 fastcgi_intercept_errors on;

  41.         gzip on;
  42.         gzip_min_length  1k;
  43.         gzip_buffers     4 16k;
  44.         gzip_http_version 1.1;
  45.         gzip_comp_level 2;
  46.         gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
  47.         gzip_vary on;
  48.         gzip_proxied   expired no-cache no-store private auth;
  49.         gzip_disable   "MSIE [1-6]\.";

  50.         limit_conn_zone $binary_remote_addr zone=perip:10m;
  51.                 limit_conn_zone $server_name zone=perserver:10m;

  52.         server_tokens off;
  53.         access_log off;

  54. server
  55.     {
  56.         listen 888;
  57.         server_name phpmyadmin;
  58.         index index.html index.htm index.php;
  59.         root  /www/server/phpmyadmin;
  60.             location ~ /tmp/ {
  61.                 return 403;
  62.             }

  63.         #error_page   404   /404.html;
  64.         include enable-php.conf;

  65.         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  66.         {
  67.             expires      30d;
  68.         }

  69.         location ~ .*\.(js|css)?$
  70.         {
  71.             expires      12h;
  72.         }

  73.         location ~ /\.
  74.         {
  75.             deny all;
  76.         }

  77.         access_log  /www/wwwlogs/access.log;
  78.     }
  79. include /www/server/panel/vhost/nginx/*.conf;
  80. }

复制代码
发表于 2021-11-15 15:33:52 | 显示全部楼层
https://blog.csdn.net/sunsineq/article/details/115942537
自己看吧。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2026-5-10 13:19 , Processed in 0.067086 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表