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 / 问题

问题[querystring](server)

Martin Hope
Amanda
Asked: 2020-09-05 05:11:39 +0800 CST

将 proxy_pass 与 nginx 一起使用时以正确的方式附加查询参数

  • 1

我的 nginx 代理传递配置设置如下:

location /try-me {
   proxy_pass https://some-domain.com?id=true&zone=false
} 

这工作正常。但问题是当浏览器中的某个人尝试

https://mywebsite.com/try-me?ping=true&foo=bar

在 proxy_pass 之后创建的最终 URL 是:

https://some-domain.com?id=true&zone=false?ping=true&foo=bar

查询参数格式完全不正确。如何确保 Nginx附加以下列方式转发的任何查询参数:

id=true&zone=false&ping=true&foo=bar
nginx reverse-proxy proxypass querystring
  • 1 个回答
  • 5082 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
George
Asked: 2016-09-08 09:53:02 +0800 CST

将第 3 方内容动态代理到 https

  • 1

我正在使用 java 和 apache,并且在我的安全页面上托管非安全的第 3 方内容,当我在 facebook 上共享我的页面时,facebooks 选项卡不会显示不安全的内容。我遇到了一篇描述这种行为的文章,我正在寻求纠正这个问题。https://www.tabsite.com/blog/chrome-and-other-browsers-not-showing-insecure-content/

由于我的内容提供商不提供安全内容,我的想法是使用 apache 将我的安全 URL 代理到第三方非安全 URL。

我将如何使我的代理动态化,这样我就不必不断地修改我的服务器映像?我最初的想法是在我的域前面加上第 3 方 URL

https://images.example.com?url=http://content-provider.com/image/1234.jpg

并用 apache rewrite 或其他东西解析它,但是我不确定这是一个合适的解决方案。我正在寻找一些想法和建议。

如何使用 mod_rewrite 将 url 重写为查询参数?

我尝试编写以下代码但没有成功

https://images.example.com?url=http://content-provider.com/image/1234.jpg

RewriteCond %{QUERY_STRING} ^url=(.*)$ [NC]
RewriteRule (.*)$ %1 [NC,L,R=301]

我希望http://content-provider.com/image/1234.jpg

proxy reverse-proxy mod-rewrite apache-2.4 querystring
  • 1 个回答
  • 618 Views
Martin Hope
icelizard
Asked: 2010-03-24 08:46:16 +0800 CST

301重定向和查询字符串

  • 1

我正在寻找纯粹基于查询字符串创建 301 重定向,请参阅 b

OLD URL: olddomain.com/?pc=/product/9999
New URL: newurl.php?var=yup

我这样做的正常方式是

redirect 301 pc=/product/9999 newurl.php?var=yup

但是这次我试图匹配一个只包含域和查询字符串的 URL...

这样做的最佳方法是什么?

谢谢

apache-2.2 .htaccess mod-rewrite querystring 301-redirect
  • 2 个回答
  • 1661 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