Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateServerLocationsを実装 #74

Closed
Yamada-Ika opened this issue Jul 19, 2022 · 2 comments · Fixed by #83
Closed

CreateServerLocationsを実装 #74

Yamada-Ika opened this issue Jul 19, 2022 · 2 comments · Fixed by #83
Assignees

Comments

@Yamada-Ika
Copy link
Collaborator

No description provided.

@Yamada-Ika Yamada-Ika self-assigned this Jul 19, 2022
@katataku
Copy link
Owner

CreateServerLocationsのペアプロ中に議論になったので相談です。

以下のような設定ファイルから幾つの ServerLocationができるでしょうか。

http {
    #client_max_body_sizeは設定しない
    error_page 404 /404.html
    server {
        server_name = "aaaaaa"
        Location /path_a {
            client_max_body_size = 999
            autoindex : true
        }
        Location /path_b {
            autoindex : false
        }
        Location /path_c {
            server_name = "cccccc"
        }
    }
    server {
        server_name = "bbbbbb"
        Location /path_aaa {
            client_max_body_size = 999
            autoindex : true
        }
    }
    server {
       server_name = "dddddd"
       listen 80
    }
}

仮説

  • 案1:4個 Locationの数
  • 案2:7個 Locationの数+Serverの数
  • 案3:5個 Locationの数+LocationのないServerの数
sl[0]={host: "aaaaaa" ,autoindex : on         ,error[404]="/404.html" ,client_max_body_size=999}         ←1つ目のserver path_a
sl[1]={host: "aaaaaa", autoindex : off        ,error[404]="/404.html" ,client_max_body_size=初期値(1024)} ←1つ目のserver path_b
sl[2]={host: "cccccc", autoindex : 初期値(off) ,error[404]="/404.html" ,client_max_body_size=初期値(1024)} ←1つ目のserver path_c
sl[3]={host: "bbbbbb" ,autoindex : on         ,error[404]="/404.html" ,client_max_body_size=999}         ←2つ目のserver path_aaa

@katataku
Copy link
Owner

議論の結果。

  • 案2:7個 Locationの数+Serverの数
  • alias の初期値 = "/usr/share/nginx/html/"
http {
    #client_max_body_sizeは設定しない
    error_page 404 /404.html
    server {
        server_name = "aaaaaa"
        Location /path_a {
            client_max_body_size = 999
            autoindex : true
            alias = '/'
        }
        Location /path_b {
            autoindex : false
        }
        Location /path_c {
            server_name = "cccccc"
        }
    }
    server {
        server_name = "bbbbbb"
        Location /path_aaa {
            client_max_body_size = 999
            autoindex : true
        }
    }
    server {
       server_name = "dddddd"
       listen 80
    }〜
}

*案2:7個 Locationの数+Serverの数*

sl[0]={host: "aaaaaa" ,autoindex : on         ,error[404]="/404.html" ,alias="/", client_max_body_size=999}         ←1つ目のserver path_a
sl[1]={host: "aaaaaa", autoindex : off        ,error[404]="/404.html" ,alias=初期値, client_max_body_size=初期値(1024)} ←1つ目のserver path_b
sl[2]={host: "cccccc", autoindex : 初期値(off) ,error[404]="/404.html" ,alias=初期値,client_max_body_size=初期値(1024)} ←1つ目のserver path_c
sl[3]={host: "bbbbbb" ,autoindex : on         ,error[404]="/404.html" ,alias=初期値,client_max_body_size=999}         ←2つ目のserver path_aaa

sl[4]={host: "aaaaaa" ,autoindex : 初期値(off) ,error[404]="/404.html" ,alias=初期値,client_max_body_size=初期値(1024)} ←1つ目のserver 
sl[5]={host: "bbbbbb" ,autoindex : 初期値(off) ,error[404]="/404.html" ,alias=初期値,client_max_body_size=初期値(1024)} ←2つ目のserver 
sl[6]={host: "dddddd" ,autoindex : 初期値(off) ,error[404]="/404.html" ,alias=初期値,client_max_body_size=初期値(1024)} ←3つ目のserver

@Yamada-Ika Yamada-Ika linked a pull request Jul 21, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants