nginx config laravel中漂亮网址的位置

问题描述 投票:0回答:1

我无法在互联网上找到信息。

我正在尝试创建一个管理区域但是留下一个没有密码的webhook(我使用htpassword)但是由于某种原因不起作用,也许它与laravel的漂亮网址有关

这是有效的,资产是一个真正的文件夹

location /assets/ {
    auth_basic          off;
    allow all;
}

这不起作用:

location /index.php/webhook {
    auth_basic          off;
    allow all;
}

所以我添加了这个但是没有工作:

try_files $uri $uri/ /index.php?$query_string;

所以我用斜线结束了这个,location /index.php/webhook/但仍然没有。

以供参考:

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name xxx.com;
    auth_basic "Restricted Content";
    auth_basic_user_file /etc/nginx/.htpasswd;
    root /home/www;
    #more configs like ssl#

    location / {
        limit_req   zone=login  burst=5  nodelay;
        limit_req_status 503;
        try_files $uri $uri/ /index.php?$query_string;
    }
}

任何的想法? :)

laravel nginx
1个回答
0
投票

我尝试了像这个https://user:[email protected]的嵌入式URL凭据,但webhook与此auth不兼容。

所以我最终做了一个解决方法,我把允许放入webhook提供商的IP,所以他们自动允许没有用户/密码。

容易吗?我花了2小时才发现这种可能性哈哈

© www.soinside.com 2019 - 2024. All rights reserved.