AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[url-routing](server)

Martin Hope
tausendschoen
Asked: 2021-08-28 08:31:25 +0800 CST

Nginx:使用 proxy_pass 和 URL 参数和特殊字符重写 URL

  • 0

我研究了所有关于 nginx 代理和重写功能的精彩帖子,但无法找到解决我的问题的方法。所以我们在这里。我用 vaadin 编写了一个 Web 应用程序,它能够处理以下请求:

http://<server>/#main/search?country=germany&type=songwriter

对于 SEO 优化,我想处理“说话”的 url,例如:http:///songwriter/germany。所以我认为在网络服务器中重写 URL 是解决方案。但是无论我尝试什么,我都无法将主题标签放在请求中并形成最终解决方案!这是我尝试过的:

  location  /songwriter/ {
        proxy_set_header Host $host;
        proxy_redirect off;
        # Option 1 - hastag is encoded
        rewrite ^/songwriter/(.+) /#main/suche?land=$1  break;
        proxy_pass http://127.0.0.1:8080; 
 }

我在跟踪中得到的是:/%23main/suche land=berlin/。任何想法?

proxy rewrite nginx url-routing
  • 1 个回答
  • 579 Views
Martin Hope
ooo
Asked: 2021-03-06 15:22:20 +0800 CST

是否可以在屏蔽的服务器端 301 重定向中显示 URL?

  • 0

我在一家搜索监控公司工作,目前正在调查一些广告,这些广告将恶意 URL 隐藏在经过掩码的服务器端重定向中。当用户点击这些广告时,他们会被重定向到位于服务器上的带有一些恶意代码的域,但该域被 URL 转发服务(如 Porkbun)屏蔽,所以我们看到的只是屏蔽域,而不是一个在幕后。我想知道,是否有任何可能的方法来获取隐藏的服务器端 URL?或者有没有办法获取有关隐藏 URL 的任何其他信息?

forwarding 301-redirect url-routing
  • 1 个回答
  • 349 Views
Martin Hope
Jaime
Asked: 2020-09-21 18:31:55 +0800 CST

适用于 Web 应用的 Azure 网关

  • 0

我们正在寻找一种 Azure 解决方案,用于通过单个入口点将传入的 API 消息(基于微服务)路由到多个Azure Web App实例 (*.azurewebsites.net),而不是多个虚拟机。

路由将基于 URL,因为 URL 部分包含微服务名称。之后,我们打算使用相同的服务进行负载均衡。

目前我们正在使用nginx带有 URL 重定向的自定义服务器来执行此操作,但我们想知道是否可以使用本机 Azure 服务。

到目前为止,它似乎Azure Application Gateway是面向 VM 的。

azure-web-apps azure-networking url-routing
  • 3 个回答
  • 190 Views
Martin Hope
Gürkan Güran
Asked: 2020-07-30 08:48:22 +0800 CST

php-fpm 和 nginx 的查询字符串问题

  • 0

我正在尝试使用 Nginx 运行 PHP 应用程序。重写 URL 可以正常工作,但是查询字符串不会传递给 PHP 文件。我在下面的配置中做错了吗?我将不胜感激任何帮助!

nginx-site.conf:

server {
    root    /var/www/html;

    include /etc/nginx/default.d/.conf;

    index index.php index.html index.htm;

    client_max_body_size 30m;

    server_tokens  off;

    location / {
        index index.html index.htm index.php;
        try_files $uri $uri/ @extensionless-php;
    }

    location ~* .(?:ico|css|js|gif|jpe?g|png|svg|woff)$ {
        expires 30d;
        add_header Pragma public;
        add_header Cache-Control "public";
    }

    location ~ \.php$ {
        fastcgi_param HTTP_PROXY "";
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include fastcgi.conf;
    }
    
    location @extensionless-php {
        if ( -f $document_root$uri.php ) {
            rewrite ^ $uri.php last;
        }
        fastcgi_pass 127.0.0.1:9000;
        include fastcgi.conf;
    }

    location ~* /includes/(.+)\.php$ {
        deny all;
    }
}
rewrite nginx php-fpm querystring url-routing
  • 2 个回答
  • 600 Views
Martin Hope
Jan Wytze
Asked: 2017-03-16 09:24:15 +0800 CST

Nginx 没有获得正确的根目录

  • 1

我试图用 api 制作一个角度应用程序。除 API 路由外,每条路由都应该转到 Angular 应用程序。API 路由应该去一个 laravel 项目。但是 API route( /api) 不起作用,它只是重定向到 Angular 应用程序。当我删除 Angular 应用程序 route( /) 时,我会在/api.

这是我的配置文件:

server {
        listen 80;
        server_name example.nl *.example.nl;

        access_log /home/example/logs/access.log;
        error_log /home/example/logs/error.log;

        root /home/example/public_html;

        location /api {
                root /home/example/public_api/public;
                index index.php;

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

                location ~ \.php$ {
                        include snippets/fastcgi-php.conf;
                        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
                }
        }

        location / {
                index index.html;
                try_files $uri$args $uri$args/ /index.html;
        }
}

当我删除最后一个块时,我得到了一个错误: open() "/usr/share/nginx/html/index.php" failed (2: No such file or directory)

但我是说root /home/example/public_api/public;。为什么它在采摘/usr/share/nginx/html?

/usr/share/nginx/html是我的default路线。

更新

Nginx 现在正在读取正确的目录,但是 PHP 坏了,这是我更新的配置文件:

server {
        listen 80;
        server_name example.nl *.example.nl;

        access_log /home/example/logs/access.log;
        error_log /home/example/logs/error.log;

        root /home/example/public_html;

        location /api {
                alias /home/example/public_api/public;
                index index.php;
                try_files $uri $uri/ /index.php?$query_string;

                location ~ \.php$ {
                        include snippets/fastcgi-php.conf;
                        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
                }
        }

        location / {
                index index.html;
                try_files $uri$args $uri$args/ /index.html;
        }
}

在我得到的错误日志中:

FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream

这是我在浏览器中得到的内容: File not found.

这是卷曲内容(/api): <html> <head><title>301 Moved Permanently</title></head> <body bgcolor="white"> <center><h1>301 Moved Permanently</h1></center> <hr><center>nginx/1.10.0 (Ubuntu)</center> </body> </html>

这是卷曲内容/api/index.php: File not found.

nginx php-fpm php7 url-routing
  • 1 个回答
  • 4748 Views
Martin Hope
cadobe
Asked: 2016-09-20 19:00:37 +0800 CST

url 上的公共 IP 地址

  • 0

我成功设置了 DNS 和具有所有要求的 Web 服务器。一切都得到正确解决,例如域名和反向代理。

我的问题是,如何将公共 IP 设置在 url 上,如下所示:服务器默认页面?.

主服务器位于防火墙路由器后面,并且基于 Windows。它位于专用的托管环境中。

带有 IIS 的 Windows Server 2012 R2

谢谢

firewall ip windows-server-2012 url-routing
  • 1 个回答
  • 606 Views
Martin Hope
bowerm
Asked: 2016-09-13 01:15:29 +0800 CST

通过 ExpressRoute 路由 Azure 服务总线流量?

  • 0

Azure 服务总线公开可公开寻址的 HTTPS 终结点。出于安全原因,我们希望通过 Express Route 而不是通过公共 Internet 强制从本地系统到 Azure 的服务总线流量。

我们怎么能做到这一点?有没有办法配置 Azure 服务总线或 Express Route 来启用它?

routing ip-routing azure url-routing
  • 1 个回答
  • 952 Views
Martin Hope
Jenni
Asked: 2010-02-19 08:04:15 +0800 CST

URL以空格结尾的Apache错误-如何解决?

  • 3

我有一个问题,一封营销电子邮件已发送给客户,其中包含指向我们网站的链接,但它以空格结尾。换句话说,它类似于http://www.example.com/somepage/%20. 发送另一封带有正确链接的电子邮件可能会被客户视为垃圾邮件,因此我们正在尝试修复它。

我尝试将重定向规则添加到.htaccess,但在到达该点之前它失败了。

Apache 错误日志显示以下错误:

(20024) 给定路径格式错误或包含无效字符:无法将 GET /cost-per-invoice-calculator/%20 HTTP/1.1 映射到文件

有什么建议么?这是 Windows 服务器上的 Apache,如果相关的话……

apache-2.2 url-routing
  • 3 个回答
  • 1929 Views
Martin Hope
jml
Asked: 2010-01-15 19:51:34 +0800 CST

从 mysite.com 重定向到 www.mysite.com

  • 3

我知道这已经被回答了很多次,所以如果有人想将我指向另一个专门回答我的问题的线程,那很好......现在,我的搜索没有产生很多结果。

所以我有一个像 mysite.com 这样的网站,其中嵌入了 Flash swf,然后我转到 www.mysite.com ... 突然间,事情无法正常工作。我想深入了解这一点,因为它根本不像页面只是“不加载”;它加载,我只能做某些事情;好像某些功能被禁用(可能是对特定 url 的 url 请求等)。

我需要在我的控制面板中管理它吗?我不会这么认为,因为网站加载;只是在 swf 中有一个残缺的功能。

我在想这可能与我的 crossdomain.xml 文件有关;会是这样吗?

感谢您的任何提示或建议。

redirect domain flash url-routing
  • 3 个回答
  • 672 Views
Martin Hope
Jon
Asked: 2010-01-11 02:52:22 +0800 CST

如何过滤/重定向进入网络的 URL?

  • 1

我不确定这是否可能,但我想做如下:

我有一个 IP 地址(动态使用zoneedit.com以使其保持更新)。我有一个网络服务器运行我的主站点,它是运行 Apache 的 Ubuntu 机器。我还有一个运行另一个站点的 Windows 2008 服务器。只是为了混淆我还在 Windows 服务器上运行我的 Apache 站点的一部分,目前proxypassreverse用于从中获取信息。它看起来像这样:

IP 1.2.3.4

maps to       example.com
as well as    example.org

所有进入端口 80 的请求都被转发到 Apache 机器,我使用 Virtualhost 设置在需要的地方代理 Windows 站点。

example.comApache 站点也是如此,example.com/mywindowssection是 Apache 服务器使用 proxypassreverse 从 Windows 服务器获取站点的一部分。

example.org使用 Apache 并proxypassreverse获取整个站点。

我想做的是将进入我的网络的所有 http 请求转发到一台机器,该机器确定谁应该为该内容提供服务?所以:

  • example.com会去Apache机器
  • example.org会去windows机器。

我正在设置一个 Astaro 网关(之前从未这样做过,所以需要一段时间来配置)作为我的防火墙、dns、dhcp 等,不知道这是否可以处理它。如果这个过程也需要一个单独的盒子,我有能力在网络上运行一个虚拟机。

感谢任何和所有的反馈。

http apache-2.2 reverse-proxy url-routing
  • 1 个回答
  • 315 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve