用了Basic Access Authentication是否會導致X Prober無法獲取需要的資訊 #56

Closed
opened 2026-01-15 11:38:30 +08:00 by yan · 8 comments
Owner

Originally created by @naruko-hstk on GitHub (Apr 23, 2021).

  • OS: Windows 10 Pro
  • PHP version: 8.0.3

我使用了Basic Access Authentication加密我的根目錄
想問一下是否會導致X Prober無法正常獲取需要的資訊
image

p.s.如有需要可透過E-mail或是Discord(結城あやの)聯絡我

Originally created by @naruko-hstk on GitHub (Apr 23, 2021). - OS: Windows 10 Pro - PHP version: 8.0.3 <!-- Your content --> 我使用了Basic Access Authentication加密我的根目錄 想問一下是否會導致X Prober無法正常獲取需要的資訊 ![image](https://user-images.githubusercontent.com/34113239/115857578-6f890b00-a460-11eb-89fd-6606d7f781f6.png) p.s.如有需要可透過[E-mail](mailto:james48118510@gmail.com)或是[Discord](https://discord.gg/Yrs5HEYdJq)(結城あやの)聯絡我
yan added the question label 2026-01-15 11:38:30 +08:00
yan closed this issue 2026-01-15 11:38:31 +08:00
Author
Owner

@kmvan commented on GitHub (Apr 24, 2021):

已发邮件咨详情

@kmvan commented on GitHub (Apr 24, 2021): 已发邮件咨详情
Author
Owner

@kmvan commented on GitHub (May 1, 2021):

能否贴一下设置验证的代码?

@kmvan commented on GitHub (May 1, 2021): 能否贴一下设置验证的代码?
Author
Owner

@naruko-hstk commented on GitHub (May 3, 2021):

server {
  listen 80;
  server_name _;
  access_log /data/wwwlogs/access_nginx.log combined;
  root /data/wwwroot/default;
  index index.html index.htm index.php;
  #error_page 404 /404.html;
  #error_page 502 /502.html;
  auth_basic_user_file ./.htpasswd;
  auth_basic "Restricted Content";
  location /nginx_status {
    stub_status on;
    access_log off;
    allow 127.0.0.1;
    deny all;
  }
  location / {
    try_files $uri @apache;
  }
  location @apache {
    proxy_pass http://127.0.0.1:88;
    include proxy.conf;
  }
  location ~ [^/]\.php(/|$) {
    proxy_pass http://127.0.0.1:88;
    include proxy.conf;
  }
  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
    expires 30d;
    access_log off;
  }
  location ~ .*\.(js|css)?$ {
        expires 7d;
    access_log off;
  }
  location ~ ^/(\.user.ini|\.ht|\.git|\.svn|\.project|LICENSE|README.md) {
    deny all;
  }
}
@naruko-hstk commented on GitHub (May 3, 2021): ```conf server { listen 80; server_name _; access_log /data/wwwlogs/access_nginx.log combined; root /data/wwwroot/default; index index.html index.htm index.php; #error_page 404 /404.html; #error_page 502 /502.html; auth_basic_user_file ./.htpasswd; auth_basic "Restricted Content"; location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; } location / { try_files $uri @apache; } location @apache { proxy_pass http://127.0.0.1:88; include proxy.conf; } location ~ [^/]\.php(/|$) { proxy_pass http://127.0.0.1:88; include proxy.conf; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ { expires 30d; access_log off; } location ~ .*\.(js|css)?$ { expires 7d; access_log off; } location ~ ^/(\.user.ini|\.ht|\.git|\.svn|\.project|LICENSE|README.md) { deny all; } } ```
Author
Owner

@kmvan commented on GitHub (May 15, 2021):

看你的配置,貌似是后端用 apache,前端用 nginx?
如果是这样的话,那原因就是这个了。
因为nginx不会给后端apache传递验证信息或nginx传递了,但apache忽略了。
这个问题可以这样解决

  1. 跳过apache,nginx直接套phpfpm,这样php才能获得验证信息,并输出到页面,js再以此传递。
@kmvan commented on GitHub (May 15, 2021): 看你的配置,貌似是后端用 apache,前端用 nginx? 如果是这样的话,那原因就是这个了。 因为nginx不会给后端apache传递验证信息或nginx传递了,但apache忽略了。 这个问题可以这样解决 1. 跳过apache,nginx直接套phpfpm,这样php才能获得验证信息,并输出到页面,js再以此传递。
Author
Owner

@naruko-hstk commented on GitHub (May 15, 2021):

嗯...
抱歉
對於這塊我是新手
方便說明一下怎麼做嗎

@naruko-hstk commented on GitHub (May 15, 2021): 嗯... 抱歉 對於這塊我是新手 方便說明一下怎麼做嗎
Author
Owner

@kmvan commented on GitHub (May 16, 2021):

通过什么方式安装 php 的?apt?yum?

@kmvan commented on GitHub (May 16, 2021): 通过什么方式安装 php 的?apt?yum?
Author
Owner

@naruko-hstk commented on GitHub (May 16, 2021):

我是用這個裝的
全部選最新版

@naruko-hstk commented on GitHub (May 16, 2021): 我是用[這個](https://github.com/oneinstack/lnmp)裝的 全部選最新版
Author
Owner

@kmvan commented on GitHub (May 17, 2021):

安装时候只用nginx足够了,apache不需要的

@kmvan commented on GitHub (May 17, 2021): 安装时候只用nginx足够了,apache不需要的
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yan/archived-x-prober#56