搜索热词

WordPress中文社区 > 帖子 > 微信小程序域名校验文件放到哪里才能被站点域名访问

微信小程序域名校验文件放到哪里才能被站点域名访问

想通过微信小程序访问wordpress其中之一的一个站点(开启了多站点),把微信小程序的域名校验文件放在了wordpress根目录下,但是通过站点域名无法访问到,请问这种应该放到哪个目录下才可以?或者是否需要修改什么配置?

发布于08月30日 被浏览 978 次
点赞 收藏 打赏 分享

    7 个回答

  1. Avatar
    L同学 0

    放在主题文件下试试看

  2. Avatar
    lucia 0

    是的,采用的是独立域名,我有试过在nginx里直接访问这个文件返回文件内容,但是都不行

  3. WordPress日记

    这个域名时https的吗

    • Avatar
      lucia 0

      @WordPress日记 是的

      • WordPress日记

        @lucia 是和wp-config.php放在同级目录下吗?域名是直接指向这个目录的吗?还有是多站点的子站采用了独立域名吗?

        • Avatar
          lucia 0

          @WordPress日记 是放在了同一层目录下,子站点是独立域名,

           

        • Avatar
          lucia 0

          @WordPress日记 server {
          listen 443 ssl;
          server_name  *.wp.distinctclinic.com *.distinctclinic.com;

          server_tokens off;

          ssl_certificate /usr/local/nginx/conf/wordpress.pem;
          ssl_certificate_key /usr/local/nginx/conf/wordpress.key;
          ssl_session_timeout 5m;
          ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4:!3DES;
          ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
          ssl_prefer_server_ciphers on;
          client_max_body_size 50m;

          access_log /data/wordpress/log/wp.access.log;
          error_log /data/wordpress/log/wp.error.log;

          root /data/wordpress;
          index index.php;

          location = /favicon.ico {
          log_not_found off;
          access_log off;
          }

          location = /robots.txt {
          allow all;
          log_not_found off;
          access_log off;
          }

          location / {
          try_files $uri $uri/ /index.php?$args;
          }

          location ~ \.php$ {
          try_files $uri =404;
          fastcgi_pass 127.0.0.1:9000;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          include fastcgi_params;
          }

          location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
          expires max;
          log_not_found off;
          }

          #ignored: “-” thing used or unknown variable in regex/rew
          rewrite ^/([_0-9a-zA-Z-]+/)?wp-admin$ /$1wp-admin/ permanent;
          if (-f $request_filename){
          set $rule_2 1;
          }
          if (-d $request_filename){
          set $rule_2 1;
          }
          if ($rule_2 = “1”){
          #ignored: “-” thing used or unknown variable in regex/rew
          }
          rewrite ^/([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) /$2 last;
          rewrite ^/([_0-9a-zA-Z-]+/)?(.*.php)$ /$2 last;
          rewrite /. /index.php last;
          }

          server
          {
          listen 80;
          server_name *.wp.distinctclinic.com;
          return 301 https://$http_host$request_uri;
          }

          server
          {
          listen 80;
          server_name *.distinctclinic.com;
          return 301 https://$http_host$request_uri;
          }

           

           

          这是nginx配置,由于是多站点情况,我不太确定是不是直接指向/data/wordpress

撰写回答

无意义的回答将很快被删除,账号将被禁止发言。 提交回答