senooken JP Social
  • FAQ
  • Login
senooken JP Socialはsenookenの専用分散SNSです。
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. らりお・ザ・何らかの🈗然㊌ソムリエ (lo48576@mastodon.cardina1.red)'s status on Thursday, 21-Oct-2021 05:20:23 JST らりお・ザ・何らかの🈗然㊌ソムリエ らりお・ザ・何らかの🈗然㊌ソムリエ

    nginx でlocation /foo/ { set $backend "backend"; proxy_pass http://$backend:12345/;}のように traliling slash を付けているはずなのに、 /foo/bar へのリクエストが backend:12345/bar でなく backend:12345/ に飛んでしまう。何故だ……

    In conversation Thursday, 21-Oct-2021 05:20:23 JST from mastodon.cardina1.red permalink
    • らりお・ザ・何らかの🈗然㊌ソムリエ (lo48576@mastodon.cardina1.red)'s status on Thursday, 21-Oct-2021 06:12:01 JST らりお・ザ・何らかの🈗然㊌ソムリエ らりお・ザ・何らかの🈗然㊌ソムリエ
      in reply to

      proxy_pass で変数使うのやめて http://backend:12345/ とダイレクトに書いたらちゃんとパス含めてリダイレクトされるようになった……何だこれ

      In conversation Thursday, 21-Oct-2021 06:12:01 JST permalink

      Attachments


    • らりお・ザ・何らかの🈗然㊌ソムリエ (lo48576@mastodon.cardina1.red)'s status on Thursday, 21-Oct-2021 06:23:16 JST らりお・ザ・何らかの🈗然㊌ソムリエ らりお・ザ・何らかの🈗然㊌ソムリエ
      in reply to

      /good/foo にアクセスするとバックエンドの /foo にアクセスが飛ぶが、 /bad/foo にアクセスすると何故かバックエンドの / にアクセスが飛ぶ。 nginx 1.21.3。

      nginx 意味わかんねえ、なんだこれ!

      In conversation Thursday, 21-Oct-2021 06:23:16 JST permalink
    • まちカドおるみん御嬢様 (orumin@mstdn.maud.io)'s status on Thursday, 21-Oct-2021 06:26:59 JST まちカドおるみん御嬢様 まちカドおるみん御嬢様
      in reply to

      @lo48576 https://kuroeveryday.blogspot.com/2019/03/effect-of-trailing-slash-on-nginx-reverse-proxy.html

      In conversation Thursday, 21-Oct-2021 06:26:59 JST permalink

      Attachments

      1. Domain not in remote thumbnail source whitelist: 1.bp.blogspot.com
        Nginxのlocationとproxy_passの末尾スラッシュによる挙動の違いを理解する | Black Everyday Company
        from @bc_rikko
        Nginxでリバースプロキシの設定をするとき、いつもlocationとproxy_passの末尾スラッシュ(Trailing Slash、トレイリングスラッシュ)による挙動の違いを忘れてしまう。ということで、locationとproxy_passのURIに末尾スラッシュをつけた場合、つけない場合でどのような挙動になるか実験した。その結果についてまとめる。
    • らりお・ザ・何らかの🈗然㊌ソムリエ (lo48576@mastodon.cardina1.red)'s status on Thursday, 21-Oct-2021 06:26:59 JST らりお・ザ・何らかの🈗然㊌ソムリエ らりお・ザ・何らかの🈗然㊌ソムリエ
      in reply to
      • まちカドおるみん御嬢様

      @orumin 私もその仕様を期待していたんですが、ホスト名に変数 ($backend 等) を使うとそもそも trailing slash の有無に関係なくリクエストのパス部が全て捨てられるという最悪仕様に遭遇したという話です……

      In conversation Thursday, 21-Oct-2021 06:26:59 JST permalink
    • らりお・ザ・何らかの🈗然㊌ソムリエ (lo48576@mastodon.cardina1.red)'s status on Thursday, 21-Oct-2021 06:27:52 JST らりお・ザ・何らかの🈗然㊌ソムリエ らりお・ザ・何らかの🈗然㊌ソムリエ
      in reply to
      • まちカドおるみん御嬢様

      @orumin proxy_pass で :9100/ しているので /good/foo や /bad/foo は :9100/foo にアクセスが飛んでほしかったんですが、 $backend:9100/ していると絶対に $backend:9100/ 自体にしかリクエストが飛ばないみたいで……

      In conversation Thursday, 21-Oct-2021 06:27:52 JST permalink
    • らりお・ザ・何らかの🈗然㊌ソムリエ (lo48576@mastodon.cardina1.red)'s status on Thursday, 21-Oct-2021 06:35:43 JST らりお・ザ・何らかの🈗然㊌ソムリエ らりお・ザ・何らかの🈗然㊌ソムリエ
      in reply to

      https://twitter.com/KOBA789/status/1450938191939211267

      そういうことかー!!!

      In conversation Thursday, 21-Oct-2021 06:35:43 JST permalink

      Attachments

      1. No result found on File_thumbnail lookup.
        https://twitter.com/koba789/status/1450938191939211267%e3%81%9d%e3%81%86%e3%81%84%e3%81%86%e3%81%93%e3%81%a8%e3%81%8b%e3%83%bc
    • らりお・ザ・何らかの🈗然㊌ソムリエ (lo48576@mastodon.cardina1.red)'s status on Thursday, 21-Oct-2021 06:36:44 JST らりお・ザ・何らかの🈗然㊌ソムリエ らりお・ザ・何らかの🈗然㊌ソムリエ
      in reply to

      https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass

      > When variables are used in proxy_pass:>> location /name/ {> proxy_pass http://127.0.0.1$request_uri;> }>> In this case, if URI is specified in the directive, it is passed to the server as is, replacing the original request URI.

      これか!

      In conversation Thursday, 21-Oct-2021 06:36:44 JST permalink

      Attachments


      1. Domain not in remote thumbnail source whitelist: nginx.org
        Module ngx_http_proxy_module
    • らりお・ザ・何らかの🈗然㊌ソムリエ (lo48576@mastodon.cardina1.red)'s status on Thursday, 21-Oct-2021 06:37:59 JST らりお・ザ・何らかの🈗然㊌ソムリエ らりお・ザ・何らかの🈗然㊌ソムリエ
      in reply to

      本来は末尾で path 系の変数を使ったとき重複させないためのルールっぽいけど、ドメイン部分の置き換えのみを意図して使った場合にも同ルールが適用されていると……完全に理解したわ

      In conversation Thursday, 21-Oct-2021 06:37:59 JST permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

senooken JP Social is a social network, courtesy of senooken. It runs on GNU social, version 2.0.2-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All senooken JP Social content and data are available under the Creative Commons Attribution 3.0 license.